Package org.elasticsearch.index.mapper
Class BlockLoaderTestRunner
java.lang.Object
org.elasticsearch.index.mapper.BlockLoaderTestRunner
Test helper for
BlockLoader. Run it like:
BlockLoaderTestRunner runner = new BlockLoaderTestRunner(params);
runner.mapperService(createMapperService...);
runner.fieldName("field").document(Map.of("field", 1));
runner.run(1);
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAllow dummy documents in test index.breaker(CircuitBreaker breaker) Set theCircuitBreakerused for the test.document()The document being parsed.voidSet the document to be parsed.voiddocument(ParsedDocument doc) Set the document to be parsed.The name of the field to load.Set the name of the field to load.mapDoc()The document to be parsed as aMap.mapperService(MapperService mapperService) Set theMapperServiceto use for the test.Configuration a non-standard matcher.voidRun the test and compare toexpected.
-
Constructor Details
-
BlockLoaderTestRunner
-
-
Method Details
-
allowDummyDocs
Allow dummy documents in test index. This defaults tofalsebut many callers are fine with these and call this. -
mapperService
Set theMapperServiceto use for the test. This must be provided before callingrun(java.lang.Object). -
breaker
Set theCircuitBreakerused for the test. This must be provided before callingrun(java.lang.Object). -
fieldName
The name of the field to load. The test sends this toMapperService.fieldType(java.lang.String). -
fieldName
Set the name of the field to load. The test sends this toMapperService.fieldType(java.lang.String). This is required before callingrun(java.lang.Object) -
matcher
Configuration a non-standard matcher. The default matcher is usually fine, and you often don't have to call this. -
document
The document being parsed. -
mapDoc
The document to be parsed as aMap. This will only work if the document was set withdocument(Map). -
document
Set the document to be parsed. A method with this name must be called before callingrun(java.lang.Object).- Throws:
IOException
-
document
Set the document to be parsed. A method with this name must be called before callingrun(java.lang.Object).- Throws:
IOException
-
run
Run the test and compare toexpected.- Throws:
IOException
-