Github user merrimanr commented on a diff in the pull request:
https://github.com/apache/metron/pull/1153#discussion_r208921801
--- Diff:
metron-platform/metron-pcap-backend/src/test/java/org/apache/metron/pcap/query/PcapCliTest.java
---
@@ -112,7 +120,24 @@ public void
runs_fixed_pcap_filter_job_with_default_argument_list() throws Excep
return new TypeSafeMatcher<Map<K, V>>() {
@Override
protected boolean matchesSafely(Map<K, V> item) {
- return item.entrySet().containsAll(map.entrySet());
+ for(K key: map.keySet()) {
+ if (key.equals(PcapOptions.HADOOP_CONF.getKey())) {
+ Configuration itemConfiguration = (Configuration)
item.get(PcapOptions.HADOOP_CONF.getKey());
+ Map<String, Object> mapConfiguration = (Map<String, Object>)
map.get(PcapOptions.HADOOP_CONF.getKey());
+ for(String setting: mapConfiguration.keySet()) {
+ if
(!mapConfiguration.get(setting).equals(itemConfiguration.get(setting, ""))) {
+ return false;
+ }
+ }
+ } else {
+ V itemValue = item.get(key);
+ V mapValue = map.get(key);
+ if (itemValue != null ? !itemValue.equals(mapValue) : mapValue
== null) {
--- End diff --
If any key/value pair doesn't match, they we want to return false. If all
key/value pairs match, then we return true. With your change, true will be
returned the first time a key/value pair matches and all others are skipped.
---