Skip to content

Commit 7c513b1

Browse files
committed
Simplify EsIntegTestCase#assertConcreteMappingsOnAll to accept concrete fields instead of wildcard patterns.
1 parent 81eefc7 commit 7c513b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
import org.elasticsearch.index.MockEngineFactoryPlugin;
127127
import org.elasticsearch.index.codec.CodecService;
128128
import org.elasticsearch.index.engine.Segment;
129+
import org.elasticsearch.index.mapper.MappedFieldType;
129130
import org.elasticsearch.index.mapper.MapperService;
130131
import org.elasticsearch.index.mapper.MockFieldFilterPlugin;
131132
import org.elasticsearch.index.seqno.SeqNoStats;
@@ -823,7 +824,7 @@ public void waitNoPendingTasksOnAll() throws Exception {
823824
}
824825

825826
/**
826-
* Waits till a (pattern) field name mappings concretely exists on all nodes. Note, this waits for the current
827+
* Waits until mappings for the provided fields exist on all nodes. Note, this waits for the current
827828
* started shards and checks for concrete mappings.
828829
*/
829830
public void assertConcreteMappingsOnAll(final String index, final String type, final String... fieldNames) throws Exception {
@@ -835,8 +836,8 @@ public void assertConcreteMappingsOnAll(final String index, final String type, f
835836
assertThat("index service doesn't exists on " + node, indexService, notNullValue());
836837
MapperService mapperService = indexService.mapperService();
837838
for (String fieldName : fieldNames) {
838-
Collection<String> matches = mapperService.simpleMatchToFullName(fieldName);
839-
assertThat("field " + fieldName + " doesn't exists on " + node, matches, Matchers.not(emptyIterable()));
839+
MappedFieldType fieldType = mapperService.fullName(fieldName);
840+
assertNotNull("field " + fieldName + " doesn't exists on " + node, fieldType);
840841
}
841842
}
842843
assertMappingOnMaster(index, type, fieldNames);

0 commit comments

Comments
 (0)