X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-client%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fclient%2FSimpleNetconfClientSessionListenerTest.java;h=65e1c8e109f280bbd3f37b67a453d51c6fedb218;hb=4377c8e7b1ac67c1fe1699adfd13fc10a3509f1f;hp=60f3ad89e1a29fb9acfea45265e3dc4da8243351;hpb=699f38ff6723788eeb1a43bc0c536f9c018c8417;p=netconf.git diff --git a/netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/SimpleNetconfClientSessionListenerTest.java b/netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/SimpleNetconfClientSessionListenerTest.java index 60f3ad89e1..65e1c8e109 100644 --- a/netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/SimpleNetconfClientSessionListenerTest.java +++ b/netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/SimpleNetconfClientSessionListenerTest.java @@ -24,23 +24,19 @@ import io.netty.util.concurrent.GenericFutureListener; import java.util.Set; import org.junit.Before; import org.junit.Test; -import org.mockito.internal.util.collections.Sets; -import org.opendaylight.netconf.api.NetconfDocumentedException; import org.opendaylight.netconf.api.NetconfMessage; import org.opendaylight.netconf.api.messages.NetconfHelloMessage; public class SimpleNetconfClientSessionListenerTest { - private Channel channel; private ChannelPromise channelFuture; - Set caps; private NetconfHelloMessage helloMessage; private NetconfMessage message; private NetconfClientSessionListener sessionListener; private NetconfClientSession clientSession; @Before - public void setUp() throws NetconfDocumentedException { + public void setUp() { channel = mock(Channel.class); channelFuture = mock(ChannelPromise.class); mockEventLoop(); @@ -48,7 +44,7 @@ public class SimpleNetconfClientSessionListenerTest { doReturn(channelFuture).when(channel).writeAndFlush(any()); doReturn(channelFuture).when(channel).writeAndFlush(any(), any(ChannelPromise.class)); doReturn(channelFuture).when(channelFuture).addListener(any(GenericFutureListener.class)); - caps = Sets.newSet("a", "b"); + final var caps = Set.of("a", "b"); helloMessage = NetconfHelloMessage.createServerHello(caps, 10); message = new NetconfMessage(helloMessage.getDocument()); sessionListener = mock(NetconfClientSessionListener.class); @@ -65,7 +61,7 @@ public class SimpleNetconfClientSessionListenerTest { } @Test - public void testSessionDown() throws Exception { + public void testSessionDown() { SimpleNetconfClientSessionListener simpleListener = new SimpleNetconfClientSessionListener(); final Future promise = simpleListener.sendRequest(message); simpleListener.onSessionUp(clientSession);