Package com.jayway.jsonassert
Interface JsonAsserter
-
- All Known Implementing Classes:
JsonAsserterImpl
@Deprecated public interface JsonAsserter
Deprecated.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description JsonAsserter
and()
Deprecated.Syntactic sugar to allow chaining assertions with a separating and() statement<T> JsonAsserter
assertEquals(java.lang.String path, T expected)
Deprecated.Asserts that object specified by path is equal to the expected value.<T> JsonAsserter
assertEquals(java.lang.String path, T expected, java.lang.String message)
Deprecated.JsonAsserter
assertNotDefined(java.lang.String path)
Deprecated.Checks that a path is not defined within a document.JsonAsserter
assertNotDefined(java.lang.String path, java.lang.String message)
Deprecated.<T> JsonAsserter
assertNotNull(java.lang.String path)
Deprecated.Asserts that object specified by path is NOT null.<T> JsonAsserter
assertNotNull(java.lang.String path, java.lang.String message)
Deprecated.JsonAsserter
assertNull(java.lang.String path)
Deprecated.Asserts that object specified by path is null.JsonAsserter
assertNull(java.lang.String path, java.lang.String message)
Deprecated.<T> JsonAsserter
assertThat(java.lang.String path, org.hamcrest.Matcher<T> matcher)
Deprecated.Asserts that object specified by path satisfies the condition specified by matcher.<T> JsonAsserter
assertThat(java.lang.String path, org.hamcrest.Matcher<T> matcher, java.lang.String message)
Deprecated.
-
-
-
Method Detail
-
assertThat
<T> JsonAsserter assertThat(java.lang.String path, org.hamcrest.Matcher<T> matcher)
Deprecated.Asserts that object specified by path satisfies the condition specified by matcher. If not, an AssertionError is thrown with information about the matcher and failing value. Example:with(json).assertThat("items[0].name", equalTo("Bobby")) .assertThat("items[0].age" , equalTo(24L))
- Type Parameters:
T
- the static type accepted by the matcher- Parameters:
path
- the json path specifying the value being comparedmatcher
- an expression, built of Matchers, specifying allowed values- Returns:
- this to allow fluent assertion chains
-
assertThat
<T> JsonAsserter assertThat(java.lang.String path, org.hamcrest.Matcher<T> matcher, java.lang.String message)
Deprecated.- Type Parameters:
T
-- Parameters:
path
-matcher
-message
-- Returns:
-
assertEquals
<T> JsonAsserter assertEquals(java.lang.String path, T expected)
Deprecated.Asserts that object specified by path is equal to the expected value. If they are not, an AssertionError is thrown with the given message.- Type Parameters:
T
- the static type that should be returned by the path- Parameters:
path
- the json path specifying the value being comparedexpected
- the expected value- Returns:
- this to allow fluent assertion chains
-
assertEquals
<T> JsonAsserter assertEquals(java.lang.String path, T expected, java.lang.String message)
Deprecated.
-
assertNotDefined
JsonAsserter assertNotDefined(java.lang.String path)
Deprecated.Checks that a path is not defined within a document. If the document contains the given path, an AssertionError is thrown- Parameters:
path
- the path to make sure not exists- Returns:
- this
-
assertNotDefined
JsonAsserter assertNotDefined(java.lang.String path, java.lang.String message)
Deprecated.
-
assertNull
JsonAsserter assertNull(java.lang.String path)
Deprecated.Asserts that object specified by path is null. If it is not, an AssertionError is thrown with the given message.- Parameters:
path
- the json path specifying the value that should be null- Returns:
- this to allow fluent assertion chains
-
assertNull
JsonAsserter assertNull(java.lang.String path, java.lang.String message)
Deprecated.
-
assertNotNull
<T> JsonAsserter assertNotNull(java.lang.String path)
Deprecated.Asserts that object specified by path is NOT null. If it is, an AssertionError is thrown with the given message.- Parameters:
path
- the json path specifying the value that should be NOT null- Returns:
- this to allow fluent assertion chains
-
assertNotNull
<T> JsonAsserter assertNotNull(java.lang.String path, java.lang.String message)
Deprecated.
-
and
JsonAsserter and()
Deprecated.Syntactic sugar to allow chaining assertions with a separating and() statementwith(json).assertThat("firstName", is(equalTo("Bobby"))).and().assertThat("lastName", is(equalTo("Ewing")))
- Returns:
- this to allow fluent assertion chains
-
-