@Test
@SuppressWarnings("deprecation")
public void testChainBuildRpcRequestFromRpcBuilder()
{
final RpcMessage req = new RpcRequestBuilder(URI.create("test"))
.setEntity(new byte[] {1,2,3,4})
.build()
.rpcBuilder()
.setEntity(new byte[] {5,6,7,8})
.build();
Assert.assertEquals(new byte[] {5,6,7,8}, req.getEntity().copyBytes());
Assert.assertTrue(req instanceof RpcRequest);
Assert.assertEquals(URI.create("test"), ((RpcRequest)req).getURI());
}