import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
import org.opendaylight.controller.netconf.api.NetconfMessage;
import org.opendaylight.controller.netconf.api.NetconfTerminationReason;
import org.opendaylight.controller.netconf.impl.NetconfServerSession;
import org.opendaylight.controller.netconf.impl.NetconfServerSessionListener;
import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
import org.opendaylight.controller.netconf.api.NetconfMessage;
import org.opendaylight.controller.netconf.api.NetconfTerminationReason;
import org.opendaylight.controller.netconf.impl.NetconfServerSession;
import org.opendaylight.controller.netconf.impl.NetconfServerSessionListener;
import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
doReturn(mock(ChannelFuture.class)).when(channel).close();
final ChannelFuture sendFuture = mock(ChannelFuture.class);
doReturn(mock(ChannelFuture.class)).when(channel).close();
final ChannelFuture sendFuture = mock(ChannelFuture.class);
@Override
public Object answer(final InvocationOnMock invocation) throws Throwable {
((GenericFutureListener) invocation.getArguments()[0]).operationComplete(sendFuture);
@Override
public Object answer(final InvocationOnMock invocation) throws Throwable {
((GenericFutureListener) invocation.getArguments()[0]).operationComplete(sendFuture);
public void testDefaultCloseSession2() throws Exception {
AutoCloseable res = mock(AutoCloseable.class);
doThrow(NetconfDocumentedException.class).when(res).close();
public void testDefaultCloseSession2() throws Exception {
AutoCloseable res = mock(AutoCloseable.class);
doThrow(NetconfDocumentedException.class).when(res).close();