Skip to content

Commit

Permalink
test: handle AggregatorTestCase.testSupportedFieldTypes
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammad Hasnain <[email protected]>
  • Loading branch information
hasnain2808 committed Feb 15, 2024
1 parent b243056 commit f0dc154
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import org.opensearch.index.fielddata.IndexFieldDataService;
import org.opensearch.index.mapper.BinaryFieldMapper;
import org.opensearch.index.mapper.CompletionFieldMapper;
import org.opensearch.index.mapper.ConstantKeywordFieldMapper;
import org.opensearch.index.mapper.ContentPath;
import org.opensearch.index.mapper.DateFieldMapper;
import org.opensearch.index.mapper.FieldAliasMapper;
Expand Down Expand Up @@ -766,6 +767,10 @@ public void testSupportedFieldTypes() throws IOException {
source.put("doc_values", "true");
}

if (mappedType.getKey().equals(ConstantKeywordFieldMapper.CONTENT_TYPE) == true) {
source.put("value", "default_value");
}

Mapper.Builder builder = mappedType.getValue().parse(fieldName, source, new MockParserContext());
FieldMapper mapper = (FieldMapper) builder.build(new BuilderContext(settings, new ContentPath()));

Expand Down

0 comments on commit f0dc154

Please sign in to comment.