You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by GitBox <gi...@apache.org> on 2019/05/10 14:54:10 UTC
[GitHub] [metron] nickwallen commented on a change in pull request #1403:
METRON-2109: Add option to use Metron GUID as the id in Elasticsearch
nickwallen commented on a change in pull request #1403: METRON-2109: Add option to use Metron GUID as the id in Elasticsearch
URL: https://github.com/apache/metron/pull/1403#discussion_r282905453
##########
File path: metron-platform/metron-common/src/test/java/org/apache/metron/common/configuration/IndexingConfigurationsTest.java
##########
@@ -0,0 +1,62 @@
+package org.apache.metron.common.configuration;
+
+import org.adrianwalker.multilinestring.Multiline;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class IndexingConfigurationsTest {
+
+ /**
+ * {
+ * "indexing.writer.metronId" : "true"
+ * }
+ */
+ @Multiline
+ private static String globalConfig;
+
+ /**
+ * {
+ * "writer" : {
+ * "metronId": true
+ * }
+ * }
+ */
+ @Multiline
+ private static String sensorConfig;
+
+ private IndexingConfigurations configurations;
+
+ @Before
+ public void setup() {
+ configurations = new IndexingConfigurations();
+ }
+
+ @Test
+ public void shouldReturnMetronId() throws Exception {
+ // verify false by default
+ assertFalse(configurations.isMetronId("sensor", "writer"));
+
+ {
+ // verify global config setting applies to any sensor
+ configurations.updateGlobalConfig(globalConfig.getBytes(StandardCharsets.UTF_8));
+
+ assertTrue(configurations.isMetronId("sensor", "writer"));
+ assertTrue(configurations.isMetronId("anySensor", "writer"));
+ }
Review comment:
Can we just break these separate code blocks into separate test cases? They seem like separate test cases unless I am misunderstanding.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services