From 9aff8c6352704c2671cdc5e5e6925f5e5e0d25b5 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 26 Nov 2015 17:00:16 +0100 Subject: [PATCH] fix compile errors --- .../SimulatePipelineRequestParsingTests.java | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/plugins/ingest/src/test/java/org/elasticsearch/plugin/ingest/transport/simulate/SimulatePipelineRequestParsingTests.java b/plugins/ingest/src/test/java/org/elasticsearch/plugin/ingest/transport/simulate/SimulatePipelineRequestParsingTests.java index e15f2f92915..1bedcc456af 100644 --- a/plugins/ingest/src/test/java/org/elasticsearch/plugin/ingest/transport/simulate/SimulatePipelineRequestParsingTests.java +++ b/plugins/ingest/src/test/java/org/elasticsearch/plugin/ingest/transport/simulate/SimulatePipelineRequestParsingTests.java @@ -29,9 +29,7 @@ import org.junit.Before; import java.io.IOException; import java.util.*; -import static org.elasticsearch.ingest.IngestDocument.MetaData.ID; -import static org.elasticsearch.ingest.IngestDocument.MetaData.INDEX; -import static org.elasticsearch.ingest.IngestDocument.MetaData.TYPE; +import static org.elasticsearch.ingest.IngestDocument.MetaData.*; import static org.elasticsearch.plugin.ingest.transport.simulate.SimulatePipelineRequest.Fields; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -64,17 +62,17 @@ public class SimulatePipelineRequestParsingTests extends ESTestCase { String index = randomAsciiOfLengthBetween(1, 10); String type = randomAsciiOfLengthBetween(1, 10); String id = randomAsciiOfLengthBetween(1, 10); - doc.put(Fields.INDEX, index); - doc.put(Fields.TYPE, type); - doc.put(Fields.ID, id); + doc.put(INDEX.getFieldName(), index); + doc.put(TYPE.getFieldName(), type); + doc.put(ID.getFieldName(), id); String fieldName = randomAsciiOfLengthBetween(1, 10); String fieldValue = randomAsciiOfLengthBetween(1, 10); doc.put(Fields.SOURCE, Collections.singletonMap(fieldName, fieldValue)); docs.add(doc); Map expectedDoc = new HashMap<>(); - expectedDoc.put(Fields.INDEX, index); - expectedDoc.put(Fields.TYPE, type); - expectedDoc.put(Fields.ID, id); + expectedDoc.put(INDEX.getFieldName(), index); + expectedDoc.put(TYPE.getFieldName(), type); + expectedDoc.put(ID.getFieldName(), id); expectedDoc.put(Fields.SOURCE, Collections.singletonMap(fieldName, fieldValue)); expectedDocs.add(expectedDoc); } @@ -86,9 +84,9 @@ public class SimulatePipelineRequestParsingTests extends ESTestCase { for (IngestDocument ingestDocument : actualRequest.getDocuments()) { Map expectedDocument = expectedDocsIterator.next(); assertThat(ingestDocument.getSource(), equalTo(expectedDocument.get(Fields.SOURCE))); - assertThat(ingestDocument.getMetadata(INDEX), equalTo(expectedDocument.get(Fields.INDEX))); - assertThat(ingestDocument.getMetadata(TYPE), equalTo(expectedDocument.get(Fields.TYPE))); - assertThat(ingestDocument.getMetadata(ID), equalTo(expectedDocument.get(Fields.ID))); + assertThat(ingestDocument.getMetadata(INDEX), equalTo(expectedDocument.get(INDEX.getFieldName()))); + assertThat(ingestDocument.getMetadata(TYPE), equalTo(expectedDocument.get(TYPE.getFieldName()))); + assertThat(ingestDocument.getMetadata(ID), equalTo(expectedDocument.get(ID.getFieldName()))); } assertThat(actualRequest.getPipeline().getId(), equalTo(SimulatePipelineRequest.SIMULATED_PIPELINE_ID)); @@ -108,17 +106,17 @@ public class SimulatePipelineRequestParsingTests extends ESTestCase { String index = randomAsciiOfLengthBetween(1, 10); String type = randomAsciiOfLengthBetween(1, 10); String id = randomAsciiOfLengthBetween(1, 10); - doc.put(Fields.INDEX, index); - doc.put(Fields.TYPE, type); - doc.put(Fields.ID, id); + doc.put(INDEX.getFieldName(), index); + doc.put(TYPE.getFieldName(), type); + doc.put(ID.getFieldName(), id); String fieldName = randomAsciiOfLengthBetween(1, 10); String fieldValue = randomAsciiOfLengthBetween(1, 10); doc.put(Fields.SOURCE, Collections.singletonMap(fieldName, fieldValue)); docs.add(doc); Map expectedDoc = new HashMap<>(); - expectedDoc.put(Fields.INDEX, index); - expectedDoc.put(Fields.TYPE, type); - expectedDoc.put(Fields.ID, id); + expectedDoc.put(INDEX.getFieldName(), index); + expectedDoc.put(TYPE.getFieldName(), type); + expectedDoc.put(ID.getFieldName(), id); expectedDoc.put(Fields.SOURCE, Collections.singletonMap(fieldName, fieldValue)); expectedDocs.add(expectedDoc); } @@ -139,9 +137,9 @@ public class SimulatePipelineRequestParsingTests extends ESTestCase { for (IngestDocument ingestDocument : actualRequest.getDocuments()) { Map expectedDocument = expectedDocsIterator.next(); assertThat(ingestDocument.getSource(), equalTo(expectedDocument.get(Fields.SOURCE))); - assertThat(ingestDocument.getMetadata(INDEX), equalTo(expectedDocument.get(Fields.INDEX))); - assertThat(ingestDocument.getMetadata(TYPE), equalTo(expectedDocument.get(Fields.TYPE))); - assertThat(ingestDocument.getMetadata(ID), equalTo(expectedDocument.get(Fields.ID))); + assertThat(ingestDocument.getMetadata(INDEX), equalTo(expectedDocument.get(INDEX.getFieldName()))); + assertThat(ingestDocument.getMetadata(TYPE), equalTo(expectedDocument.get(TYPE.getFieldName()))); + assertThat(ingestDocument.getMetadata(ID), equalTo(expectedDocument.get(ID.getFieldName()))); } assertThat(actualRequest.getPipeline().getId(), equalTo(SimulatePipelineRequest.SIMULATED_PIPELINE_ID));