Class TestIngestDocument

java.lang.Object
org.elasticsearch.ingest.TestIngestDocument

public class TestIngestDocument extends Object
Construct ingest documents for testing purposes
  • Field Details

  • Constructor Details

    • TestIngestDocument

      public TestIngestDocument()
  • Method Details

    • withNullableVersion

      public static IngestDocument withNullableVersion(Map<String,Object> sourceAndMetadata)
      Create an IngestDocument for testing that pass an empty mutable map for ingestMetaata
    • ofIngestWithNullableVersion

      public static IngestDocument ofIngestWithNullableVersion(Map<String,Object> sourceAndMetadata, Map<String,Object> ingestMetadata)
      Create an IngestDocument from the given sourceAndMetadata and ingestMetadata and a version validator that allows null _versions. Normally null _version is not allowed, but many tests don't care about that invariant.
    • withDefaultVersion

      public static IngestDocument withDefaultVersion(Map<String,Object> sourceAndMetadata)
      Create an IngestDocument with DEFAULT_VERSION as the _version metadata, if _version is not already present.
    • ofMetadataWithValidator

      public static IngestDocument ofMetadataWithValidator(Map<String,Object> metadata, Map<String,Metadata.FieldProperty<?>> properties)
      Create an IngestDocument with a metadata map and validators. The metadata map is passed by reference, not copied, so callers can observe changes to the map directly.
    • emptyIngestDocument

      public static IngestDocument emptyIngestDocument()
      Create an empty ingest document for testing. Adds the required "_version" metadata key with value DEFAULT_VERSION.
    • randomMetadata

      public static org.elasticsearch.core.Tuple<String,Object> randomMetadata()
    • randomVersion

      public static long randomVersion()