summaryrefslogtreecommitdiff
path: root/plugins/ingest-attachment
diff options
context:
space:
mode:
authorAlexander Reelsen <alexander@reelsen.net>2016-02-10 15:29:16 +0100
committerAlexander Reelsen <alexander@reelsen.net>2016-02-10 15:29:16 +0100
commite8d24d10dcd3c720f2bcadb5b01aa1effda37d74 (patch)
tree580d31ccc63b9ca127f4fd8f33aac05176fd7805 /plugins/ingest-attachment
parentfb7723c1864c6489b5f8514668c31cec30cbb940 (diff)
Tests: Fix AttachmentProcessorFactoryTests to only check for existing fields
Diffstat (limited to 'plugins/ingest-attachment')
-rw-r--r--plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorFactoryTests.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorFactoryTests.java b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorFactoryTests.java
index 469a0f8629..7d48b217ab 100644
--- a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorFactoryTests.java
+++ b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorFactoryTests.java
@@ -32,6 +32,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.sameInstance;
import static org.hamcrest.core.Is.is;
@@ -101,8 +102,11 @@ public class AttachmentProcessorFactoryTests extends ESTestCase {
factory.create(config);
fail("exception expected");
} catch (ElasticsearchParseException e) {
- assertThat(e.getMessage(), equalTo("[fields] illegal field option [invalid]. valid values are " +
- "[CONTENT, TITLE, NAME, AUTHOR, KEYWORDS, DATE, CONTENT_TYPE, CONTENT_LENGTH, LANGUAGE]"));
+ assertThat(e.getMessage(), containsString("[fields] illegal field option [invalid]"));
+ // ensure allowed fields are mentioned
+ for (AttachmentProcessor.Field field : AttachmentProcessor.Field.values()) {
+ assertThat(e.getMessage(), containsString(field.name()));
+ }
}
config = new HashMap<>();