final SchemaResolutionException schemaResolutionException =
new SchemaResolutionException("fail first", TEST_SID, new Throwable("YangTools parser fail"));
doAnswer(invocation -> {
- if (((Collection<?>) invocation.getArguments()[0]).size() == 2) {
+ if (invocation.getArgument(0, Collection.class).size() == 2) {
return Futures.immediateFailedFuture(schemaResolutionException);
} else {
return Futures.immediateFuture(SCHEMA_CONTEXT);
netconfSpy.onRemoteSessionUp(sessionCaps.replaceModuleCaps(moduleBasedCaps), listener);
- final ArgumentCaptor<NetconfDeviceSchema> argument = ArgumentCaptor.forClass(NetconfDeviceSchema.class);
+ final var argument = ArgumentCaptor.forClass(NetconfDeviceSchema.class);
verify(facade, timeout(5000)).onDeviceConnected(argument.capture(), any(NetconfSessionPreferences.class),
any(RemoteDeviceServices.class));
argument.getValue().capabilities().resolvedCapabilities()
netconfSpy.onRemoteSessionUp(sessionCaps, listener);
- final ArgumentCaptor<NetconfDeviceSchema> argument = ArgumentCaptor.forClass(NetconfDeviceSchema.class);
+ final var argument = ArgumentCaptor.forClass(NetconfDeviceSchema.class);
verify(facade, timeout(5000)).onDeviceConnected(argument.capture(), any(NetconfSessionPreferences.class),
any(RemoteDeviceServices.class));
netconfSpy.onRemoteSessionUp(sessionCaps, listener);
- final ArgumentCaptor<NetconfDeviceSchema> argument = ArgumentCaptor.forClass(NetconfDeviceSchema.class);
+ final var argument = ArgumentCaptor.forClass(NetconfDeviceSchema.class);
verify(facade, timeout(5000)).onDeviceConnected(argument.capture(), any(NetconfSessionPreferences.class),
any(RemoteDeviceServices.class));
final NetconfDeviceCapabilities netconfDeviceCaps = argument.getValue().capabilities();