X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-netty-util%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2FAbstractNetconfSessionNegotiatorTest.java;h=da75cc16de97c033be0b079b345976f1415b8c80;hb=ed635bd35457055fb23203b825089bf97ce88645;hp=68decb5ac5e246e2fb24dc49e949ca00efd1c652;hpb=9612e983a55540fdd30631db943bb303520f890c;p=netconf.git diff --git a/netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiatorTest.java b/netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiatorTest.java index 68decb5ac5..da75cc16de 100644 --- a/netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiatorTest.java +++ b/netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiatorTest.java @@ -20,9 +20,11 @@ import static org.opendaylight.netconf.nettyutil.AbstractChannelInitializer.NETC import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelOutboundHandler; import io.netty.channel.ChannelOutboundHandlerAdapter; +import io.netty.channel.ChannelPromise; import io.netty.channel.embedded.EmbeddedChannel; import io.netty.handler.ssl.SslHandler; import io.netty.util.HashedWheelTimer; @@ -107,7 +109,7 @@ public class AbstractNetconfSessionNegotiatorTest { @Test public void testStartNegotiationNotEstablished() throws Exception { - final ChannelOutboundHandler closedDetector = Mockito.spy(new ChannelOutboundHandlerAdapter()); + final ChannelOutboundHandler closedDetector = Mockito.spy(new CloseDetector()); channel.pipeline().addLast("closedDetector", closedDetector); doReturn(false).when(promise).isDone(); doReturn(false).when(promise).isCancelled(); @@ -161,4 +163,11 @@ public class AbstractNetconfSessionNegotiatorTest { channel.pipeline().fireExceptionCaught(cause); verify(promise).setFailure(cause); } + + private static class CloseDetector extends ChannelOutboundHandlerAdapter { + @Override + public void close(ChannelHandlerContext ctx, ChannelPromise promise) { + // Override needed so @Skip from superclass is not effective + } + } }