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_r286057378
 
 

 ##########
 File path: 
metron-platform/metron-elasticsearch/src/test/java/org/apache/metron/elasticsearch/integration/ElasticsearchSearchIntegrationTest.java
 ##########
 @@ -145,7 +145,11 @@ protected static void loadTestData() throws Exception {
     for (Object broObject: (JSONArray) new JSONParser().parse(broData)) {
       broDocuments.add(((JSONObject) broObject).toJSONString());
     }
-    es.add(BRO_INDEX, "bro", broDocuments);
+    // add documents using Metron GUID
+    es.add(BRO_INDEX, "bro", broDocuments.subList(0, 4), true);
+
+    // add a document to the same index but with an Elasticsearch id
+    es.add(BRO_INDEX, "bro", broDocuments.subList(4, 5), false);
 
 Review comment:
   This is a really simple solution to ensure that the read logic works no 
matter how the document ID is written.  I had thought we would need to run the 
integration tests twice; once for each.  I can't think of a fault with this 
approach. Great idea!
   
   Are you sure that our tests are sensitive enough to fail if for example, 
they can't read just 1 our of the 5 documents written here?  For example, 
comment out either line 149 or 152 and the tests should fail.  That would make 
me completely comfortable with this approach.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to