Nick Allen created METRON-2168: ---------------------------------- Summary: Elasticsearch Updates Not Tested in Integration Test Key: METRON-2168 URL: https://issues.apache.org/jira/browse/METRON-2168 Project: Metron Issue Type: Bug Reporter: Nick Allen Assignee: Nick Allen Attachments: test-failure.log
The `ElasticsearchUpdateIntegrationTest` is not testing that the `ElasticsearchDao` can update and retrieve values in a manner similar to what would occur in production. Within the Elasticsearch index, the test fails to define the 'guid' field to be of type 'keyword', instead the type is defaulted to 'text'. In a production setting this mistake would prevent any documents from being found by guid. Unfortunately, the test passes despite this. The test needs to match the behavior of what a user would experience in production. h3. Why? These problems arise because of the way the test is setup. Instead of directly testing an `ElasticsearchDao` as you might expect this test runs against a `MultiIndexDao` initialized with both an `ElasticseachDao` and an `HBaseDao`. On retrievals the `MultIndexDao` will return the document from whichever index responds first. With the current test setup, the underlying ElasticsearchDao will never retrieve the document that the test case is expected. In all cases where the test passes, the document is actually being returned from the HBaseDao which is actually just interacting with a mock backend. The test needs to actually test that we can update and retrieve documents from Elasticsearch. If you alter the test to run against just an `ElasticsearchDao` the test will fail as follows in the attached log file. -- This message was sent by Atlassian JIRA (v7.6.3#76005)