@Test
public void testInit() throws Exception {

    String applicationId = "app 1";
    String transactionServiceGroup = "group A";
    TmRpcClient tmRpcClient = TmRpcClient.getInstance(applicationId, transactionServiceGroup);
    tmRpcClient.init();
    //check if attr of tmRpcClient object has been set success
    Field clientBootstrapField = getDeclaredField(tmRpcClient, "clientBootstrap");
    clientBootstrapField.setAccessible(true);
    RpcClientBootstrap clientBootstrap = (RpcClientBootstrap)clientBootstrapField.get(tmRpcClient);
    Field bootstrapField = getDeclaredField(clientBootstrap, "bootstrap");
    bootstrapField.setAccessible(true);
    Bootstrap bootstrap = (Bootstrap) bootstrapField.get(clientBootstrap);
    Assertions.assertNotNull(bootstrap);
    Field optionsField = getDeclaredField(bootstrap, "options");
    optionsField.setAccessible(true);
    Map<ChannelOption<?>, Object> options = (Map<ChannelOption<?>, Object>)optionsField.get(bootstrap);
    Assertions.assertTrue(Boolean.TRUE.equals(options.get(ChannelOption.TCP_NODELAY)));
    Assertions.assertTrue(Boolean.TRUE.equals(options.get(ChannelOption.SO_KEEPALIVE)));
    Assertions.assertEquals(10000, options.get(ChannelOption.CONNECT_TIMEOUT_MILLIS));
    Assertions.assertTrue(Boolean.TRUE.equals(options.get(ChannelOption.SO_KEEPALIVE)));
    Assertions.assertEquals(153600, options.get(ChannelOption.SO_RCVBUF));
    Field channelFactoryField = getDeclaredField(bootstrap, "channelFactory");
    channelFactoryField.setAccessible(true);
    ChannelFactory<? extends Channel>
        channelFactory = (ChannelFactory<? extends Channel>)channelFactoryField.get(bootstrap);
    Assertions.assertNotNull(channelFactory);
    Assertions.assertTrue(channelFactory.newChannel() instanceof NioSocketChannel);
}