Package org.elasticsearch.ingest
Class TestIngestDocument
java.lang.Object
org.elasticsearch.ingest.TestIngestDocument
Construct ingest documents for testing purposes
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IngestDocumentCreate an empty ingest document for testing.static IngestDocumentofIngestWithNullableVersion(Map<String, Object> sourceAndMetadata, Map<String, Object> ingestMetadata) Create anIngestDocumentfrom the given sourceAndMetadata and ingestMetadata and a version validator that allows null _versions.static IngestDocumentofMetadataWithValidator(Map<String, Object> metadata, Map<String, Metadata.FieldProperty<?>> properties) Create an IngestDocument with a metadata map and validators.static longstatic IngestDocumentwithDefaultVersion(Map<String, Object> sourceAndMetadata) Create anIngestDocumentwithDEFAULT_VERSIONas the _version metadata, if _version is not already present.static IngestDocumentwithNullableVersion(Map<String, Object> sourceAndMetadata) Create an IngestDocument for testing that pass an empty mutable map for ingestMetaata
-
Field Details
-
DEFAULT_VERSION
public static final long DEFAULT_VERSION- See Also:
-
-
Constructor Details
-
TestIngestDocument
public TestIngestDocument()
-
-
Method Details
-
withNullableVersion
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 anIngestDocumentfrom 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
Create anIngestDocumentwithDEFAULT_VERSIONas 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
Create an empty ingest document for testing. Adds the required"_version"metadata key with valueDEFAULT_VERSION. -
randomMetadata
-
randomVersion
public static long randomVersion()
-