Compare lists in TestIMdsalApiManager 52/77452/2
authorStephen Kitt <skitt@redhat.com>
Fri, 2 Nov 2018 13:03:43 +0000 (14:03 +0100)
committerSam Hague <shague@redhat.com>
Fri, 2 Nov 2018 16:05:21 +0000 (16:05 +0000)
assertFlows() ends up comparing a list to a set, which works with
Xtends’s text representations but fails with equals(). This patch
stores the contents of the set in a list before comparing.

Change-Id: I106f6ee9c5a4fdbaf3a3ba256bcae837cb6f2198
Signed-off-by: Stephen Kitt <skitt@redhat.com>
mdsalutil/mdsalutil-api/src/test/java/org/opendaylight/genius/mdsalutil/interfaces/testutils/TestIMdsalApiManager.java

index 72efc6b744468f3bdc40523a42ed2f92d78176ed..5ed402d35a7ca481013699a6307152e8584099cc 100644 (file)
@@ -21,6 +21,7 @@ import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import java.math.BigInteger;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
@@ -89,7 +90,7 @@ public abstract class TestIMdsalApiManager implements IMdsalApiManager {
         }
         // TODO Support Iterable <-> List directly within XtendBeanGenerator
         List<FlowEntity> expectedFlowsAsNewArrayList = Lists.newArrayList(expectedFlows);
-        assertEqualBeans(expectedFlowsAsNewArrayList, nonNullFlows);
+        assertEqualBeans(expectedFlowsAsNewArrayList, new ArrayList<>(nonNullFlows));
     }