Class AbstractSchemaValidationTestCase<T extends org.elasticsearch.common.xcontent.ToXContent>

java.lang.Object
org.junit.Assert
org.apache.lucene.util.LuceneTestCase
org.elasticsearch.test.ESTestCase
org.elasticsearch.test.AbstractSchemaValidationTestCase<T>

public abstract class AbstractSchemaValidationTestCase<T extends org.elasticsearch.common.xcontent.ToXContent>
extends ESTestCase
Test case for validating ToXContent objects against a json schema.
  • Field Details

  • Constructor Details

    • AbstractSchemaValidationTestCase

      public AbstractSchemaValidationTestCase()
  • Method Details

    • testSchema

      public final void testSchema() throws java.io.IOException
      Throws:
      java.io.IOException
    • createTestInstance

      protected abstract T createTestInstance()
      Creates a random instance to use in the schema tests. Override this method to return the random instance that you build which must implement ToXContent.
    • getJsonSchemaFileName

      protected abstract java.lang.String getJsonSchemaFileName()
      Return the filename of the schema file used for testing.
    • getToXContentParams

      protected org.elasticsearch.common.xcontent.ToXContent.Params getToXContentParams()
      Params that have to be provided when calling ToXContent.toXContent(XContentBuilder, ToXContent.Params)
    • getSchemaLocation

      protected java.lang.String getSchemaLocation()
      Root folder for all schema files.
    • getSchemaVersion

      protected com.networknt.schema.SpecVersion.VersionFlag getSchemaVersion()
      Version of the Json Schema Spec to be used by the test.