Class Assertion
java.lang.Object
org.elasticsearch.test.rest.yaml.section.Assertion
- All Implemented Interfaces:
ExecutableSection
- Direct Known Subclasses:
CloseToAssertion,ContainsAssertion,ExistsAssertion,GreaterThanAssertion,GreaterThanEqualToAssertion,IsAfterAssertion,IsFalseAssertion,IsTrueAssertion,LengthAssertion,LessThanAssertion,LessThanOrEqualToAssertion,MatchAssertion,NotExistsAssertion
Base class for executable sections that hold assertions
-
Field Summary
Fields inherited from interface org.elasticsearch.test.rest.yaml.section.ExecutableSection
DEFAULT_EXECUTABLE_CONTEXTS, XCONTENT_REGISTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidExecutes the assertion comparing the actual value (parsed from the response) with the expected onefinal voidexecute(ClientYamlTestExecutionContext executionContext) Executes the section passing in the execution contextprotected final ObjectgetActualValue(ClientYamlTestExecutionContext executionContext) final Objectfinal StringgetField()org.elasticsearch.xcontent.XContentLocationGet the location in the test that this was defined.protected final ObjectresolveExpectedValue(ClientYamlTestExecutionContext executionContext) protected Class<?> a utility to get the class of an object, protecting for null (i.e., returning null if the input is null)
-
Constructor Details
-
Assertion
-
-
Method Details
-
getField
-
getExpectedValue
-
resolveExpectedValue
protected final Object resolveExpectedValue(ClientYamlTestExecutionContext executionContext) throws IOException - Throws:
IOException
-
getActualValue
protected final Object getActualValue(ClientYamlTestExecutionContext executionContext) throws IOException - Throws:
IOException
-
getLocation
public org.elasticsearch.xcontent.XContentLocation getLocation()Description copied from interface:ExecutableSectionGet the location in the test that this was defined.- Specified by:
getLocationin interfaceExecutableSection
-
execute
Description copied from interface:ExecutableSectionExecutes the section passing in the execution context- Specified by:
executein interfaceExecutableSection- Throws:
IOException
-
doAssert
Executes the assertion comparing the actual value (parsed from the response) with the expected one -
safeClass
a utility to get the class of an object, protecting for null (i.e., returning null if the input is null)
-