{
NettyThriftDecoder decoder = new NettyThriftDecoder();
ChannelHandlerContext ctx = EasyMock.createMock(ChannelHandlerContext.class);
Channel channel = EasyMock.createMock(Channel.class);
EasyMock.expect(ctx.getChannel()).andReturn(channel);
ctx.sendUpstream(EasyMock.anyObject(ChannelEvent.class));
EasyMock.replay(ctx, channel);
try {
Object rand = new Object();
Object obj = decoder.decode(ctx, channel, rand);
Assert.assertEquals(rand, obj);