ExecutableSectionGreaterThanAssertion, GreaterThanEqualToAssertion, IsFalseAssertion, IsTrueAssertion, LengthAssertion, LessThanAssertion, LessThanOrEqualToAssertion, MatchAssertionpublic abstract class Assertion extends java.lang.Object implements ExecutableSection
XCONTENT_REGISTRY| Modifier | Constructor | Description |
|---|---|---|
protected |
Assertion(XContentLocation location,
java.lang.String field,
java.lang.Object expectedValue) |
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract void |
doAssert(java.lang.Object actualValue,
java.lang.Object expectedValue) |
Executes the assertion comparing the actual value (parsed from the response) with the expected one
|
void |
execute(ClientYamlTestExecutionContext executionContext) |
Executes the section passing in the execution context
|
protected java.lang.Object |
getActualValue(ClientYamlTestExecutionContext executionContext) |
|
java.lang.Object |
getExpectedValue() |
|
java.lang.String |
getField() |
|
XContentLocation |
getLocation() |
Get the location in the test that this was defined.
|
protected java.lang.Object |
resolveExpectedValue(ClientYamlTestExecutionContext executionContext) |
|
protected java.lang.Class<?> |
safeClass(java.lang.Object o) |
a utility to get the class of an object, protecting for null (i.e., returning null if the input is null)
|
protected Assertion(XContentLocation location, java.lang.String field, java.lang.Object expectedValue)
public final java.lang.String getField()
public final java.lang.Object getExpectedValue()
protected final java.lang.Object resolveExpectedValue(ClientYamlTestExecutionContext executionContext) throws java.io.IOException
java.io.IOExceptionprotected final java.lang.Object getActualValue(ClientYamlTestExecutionContext executionContext) throws java.io.IOException
java.io.IOExceptionpublic XContentLocation getLocation()
ExecutableSectiongetLocation in interface ExecutableSectionpublic final void execute(ClientYamlTestExecutionContext executionContext) throws java.io.IOException
ExecutableSectionexecute in interface ExecutableSectionjava.io.IOExceptionprotected abstract void doAssert(java.lang.Object actualValue,
java.lang.Object expectedValue)
protected java.lang.Class<?> safeClass(java.lang.Object o)