Clean up NetconfDeviceTest 06/105206/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 4 Apr 2023 07:16:49 +0000 (09:16 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 19 Apr 2023 12:30:26 +0000 (12:30 +0000)
Use anyCollection() consistently to reduce the number of warnings.

Change-Id: I4ac1362640d6989e301d776b139c94c14b5e9c20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
plugins/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDeviceTest.java

index f15fad463e734730aeef083e9142e6c06cd1dfd2..b5f4a2169ce88358e7fdccce18eaa1cbc25b3b14 100644 (file)
@@ -260,7 +260,7 @@ public class NetconfDeviceTest extends AbstractTestModelTest {
         final NetconfDeviceCommunicator listener = getListener();
         final EffectiveModelContextFactory schemaContextProviderFactory = mock(EffectiveModelContextFactory.class);
         final SettableFuture<SchemaContext> schemaFuture = SettableFuture.create();
-        doReturn(schemaFuture).when(schemaContextProviderFactory).createEffectiveModelContext(any(Collection.class));
+        doReturn(schemaFuture).when(schemaContextProviderFactory).createEffectiveModelContext(anyCollection());
         final NetconfDevice.SchemaResourcesDTO schemaResourcesDTO =
                 new NetconfDevice.SchemaResourcesDTO(getSchemaRegistry(), getSchemaRepository(),
                         schemaContextProviderFactory, STATE_SCHEMAS_RESOLVER);
@@ -310,7 +310,7 @@ public class NetconfDeviceTest extends AbstractTestModelTest {
                 Lists.newArrayList(TEST_NAMESPACE + "?module=" + TEST_MODULE + "&amp;revision=" + TEST_REVISION));
         device.onRemoteSessionUp(sessionCaps, listener);
 
-        verify(schemaContextProviderFactory, timeout(5000)).createEffectiveModelContext(any(Collection.class));
+        verify(schemaContextProviderFactory, timeout(5000)).createEffectiveModelContext(anyCollection());
         verify(facade, timeout(5000)).onDeviceConnected(
                 any(NetconfDeviceSchema.class), any(NetconfSessionPreferences.class), any(RemoteDeviceServices.class));
 
@@ -319,7 +319,7 @@ public class NetconfDeviceTest extends AbstractTestModelTest {
 
         device.onRemoteSessionUp(sessionCaps, listener);
 
-        verify(schemaContextProviderFactory, timeout(5000).times(2)).createEffectiveModelContext(any(Collection.class));
+        verify(schemaContextProviderFactory, timeout(5000).times(2)).createEffectiveModelContext(anyCollection());
         verify(facade, timeout(5000).times(2)).onDeviceConnected(
                 any(NetconfDeviceSchema.class), any(NetconfSessionPreferences.class), any(RemoteDeviceServices.class));
     }
@@ -330,7 +330,7 @@ public class NetconfDeviceTest extends AbstractTestModelTest {
         final NetconfDeviceCommunicator listener = getListener();
         final EffectiveModelContextFactory schemaContextProviderFactory = mock(EffectiveModelContextFactory.class);
         final SettableFuture<SchemaContext> schemaFuture = SettableFuture.create();
-        doReturn(schemaFuture).when(schemaContextProviderFactory).createEffectiveModelContext(any(Collection.class));
+        doReturn(schemaFuture).when(schemaContextProviderFactory).createEffectiveModelContext(anyCollection());
         final NetconfDevice.SchemaResourcesDTO schemaResourcesDTO
                 = new NetconfDevice.SchemaResourcesDTO(getSchemaRegistry(), getSchemaRepository(),
                 schemaContextProviderFactory, STATE_SCHEMAS_RESOLVER);
@@ -517,7 +517,7 @@ public class NetconfDeviceTest extends AbstractTestModelTest {
     private static EffectiveModelContextFactory getSchemaFactory() throws Exception {
         final EffectiveModelContextFactory schemaFactory = mockClass(EffectiveModelContextFactory.class);
         doReturn(Futures.immediateFuture(SCHEMA_CONTEXT))
-                .when(schemaFactory).createEffectiveModelContext(any(Collection.class));
+                .when(schemaFactory).createEffectiveModelContext(anyCollection());
         return schemaFactory;
     }