|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jayway.jsonassert.impl.JsonAsserterImpl
public class JsonAsserterImpl
User: kalle stenflo Date: 1/21/11 Time: 3:43 PM
| Constructor Summary | |
|---|---|
JsonAsserterImpl(java.lang.Object jsonObject)
Instantiates a new JSONAsserter |
|
| Method Summary | ||
|---|---|---|
JsonAsserter |
and()
Syntactic sugar to allow chaining assertions with a separating and() statement
with(json).assertThat("firstName", is(equalTo("Bobby"))).and().assertThat("lastName", is(equalTo("Ewing")))
|
|
|
assertEquals(java.lang.String path,
T expected)
Asserts that object specified by path is equal to the expected value. |
|
JsonAsserter |
assertNotDefined(java.lang.String path)
Checks that a path is not defined within a document. |
|
|
assertNotNull(java.lang.String path)
Asserts that object specified by path is NOT null. |
|
JsonAsserter |
assertNull(java.lang.String path)
Asserts that object specified by path is null. |
|
|
assertThat(java.lang.String path,
org.hamcrest.Matcher<T> matcher)
Asserts that object specified by path satisfies the condition specified by matcher. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonAsserterImpl(java.lang.Object jsonObject)
jsonObject - the object to make asserts on| Method Detail |
|---|
public <T> JsonAsserter assertThat(java.lang.String path,
org.hamcrest.Matcher<T> matcher)
with(json).assertThat("items[0].name", equalTo("Bobby"))
.assertThat("items[0].age" , equalTo(24L))
assertThat in interface JsonAsserterT - the static type accepted by the matcherpath - the json path specifying the value being comparedmatcher - an expression, built of Matchers, specifying allowed values
public <T> JsonAsserter assertEquals(java.lang.String path,
T expected)
assertEquals in interface JsonAsserterT - the static type that should be returned by the pathpath - the json path specifying the value being comparedexpected - the expected value
public JsonAsserter assertNotDefined(java.lang.String path)
assertNotDefined in interface JsonAsserterpath - the path to make sure not exists
public JsonAsserter assertNull(java.lang.String path)
assertNull in interface JsonAsserterpath - the json path specifying the value that should be null
public <T> JsonAsserter assertNotNull(java.lang.String path)
assertNotNull in interface JsonAsserterpath - the json path specifying the value that should be NOT null
public JsonAsserter and()
with(json).assertThat("firstName", is(equalTo("Bobby"))).and().assertThat("lastName", is(equalTo("Ewing")))
and in interface JsonAsserter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||