Package org.elasticsearch.ingest
Class TestIngestDocument
java.lang.Object
org.elasticsearch.ingest.TestIngestDocument
Construct ingest documents for testing purposes
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IngestDocument
Create an empty ingest document for testing.static IngestDocument
ofIngestWithNullableVersion
(Map<String, Object> sourceAndMetadata, Map<String, Object> ingestMetadata) Create anIngestDocument
from the given sourceAndMetadata and ingestMetadata and a version validator that allows null _versions.static IngestDocument
ofMetadataWithValidator
(Map<String, Object> metadata, Map<String, Metadata.FieldProperty<?>> properties) Create an IngestDocument with a metadata map and validators.static long
static IngestDocument
withDefaultVersion
(Map<String, Object> sourceAndMetadata) Create anIngestDocument
withDEFAULT_VERSION
as the _version metadata, if _version is not already present.static IngestDocument
withNullableVersion
(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 anIngestDocument
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
Create anIngestDocument
withDEFAULT_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
Create an empty ingest document for testing. Adds the required"_version"
metadata key with valueDEFAULT_VERSION
. -
randomMetadata
-
randomVersion
public static long randomVersion()
-