Class LengthAssertion

java.lang.Object
org.elasticsearch.test.rest.yaml.section.Assertion
org.elasticsearch.test.rest.yaml.section.LengthAssertion
All Implemented Interfaces:
ExecutableSection

public class LengthAssertion
extends Assertion
Represents a length assert section:

- length: { hits.hits: 1 }

  • Field Summary

    Fields inherited from interface org.elasticsearch.test.rest.yaml.section.ExecutableSection

    DEFAULT_EXECUTABLE_CONTEXTS, XCONTENT_REGISTRY
  • Constructor Summary

    Constructors
    Constructor Description
    LengthAssertion​(org.elasticsearch.common.xcontent.XContentLocation location, java.lang.String field, java.lang.Object expectedValue)  
  • Method Summary

    Modifier and Type Method Description
    protected 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
    static LengthAssertion parse​(org.elasticsearch.common.xcontent.XContentParser parser)  

    Methods inherited from class org.elasticsearch.test.rest.yaml.section.Assertion

    execute, getActualValue, getExpectedValue, getField, getLocation, resolveExpectedValue, safeClass

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LengthAssertion

      public LengthAssertion​(org.elasticsearch.common.xcontent.XContentLocation location, java.lang.String field, java.lang.Object expectedValue)
  • Method Details

    • parse

      public static LengthAssertion parse​(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • doAssert

      protected void doAssert​(java.lang.Object actualValue, java.lang.Object expectedValue)
      Description copied from class: Assertion
      Executes the assertion comparing the actual value (parsed from the response) with the expected one
      Specified by:
      doAssert in class Assertion