diff options
Diffstat (limited to 'core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java')
-rw-r--r-- | core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java b/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java index 3c9a1c16d1..5543baff1a 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java @@ -20,9 +20,11 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.ExceptionsHelper; +import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.KeywordFieldMapper.KeywordFieldType; import org.elasticsearch.index.mapper.MapperService.MergeReason; @@ -91,7 +93,7 @@ public class MapperServiceTests extends ESSingleNodeTestCase { public void testIndexIntoDefaultMapping() throws Throwable { // 1. test implicit index creation ExecutionException e = expectThrows(ExecutionException.class, () -> { - client().prepareIndex("index1", MapperService.DEFAULT_MAPPING, "1").setSource("{}").execute().get(); + client().prepareIndex("index1", MapperService.DEFAULT_MAPPING, "1").setSource("{}", XContentType.JSON).execute().get(); }); Throwable throwable = ExceptionsHelper.unwrapCause(e.getCause()); if (throwable instanceof IllegalArgumentException) { |