when(ctx.channel()).thenReturn(dc);
when(ctx.writeAndFlush(any(), any(ChannelPromise.class))).thenReturn(
null);
Attribute<InetSocketAddress> attr = mock(Attribute.class);
when(ctx.attr(any(AttributeKey.class))).thenReturn(attr);
when(ctx.fireChannelRead(any())).then(new Answer<Void>() {
@Override
public Void answer(final InvocationOnMock invocation)
throws Throwable {