@Test
    public void testSyncHandle() {
        RequestBody b1 = new RequestBody(1, "hello world sync");
        try {
            Object ret = client.invokeSync(addr, b1, 3000);
            logger.warn("Result received in sync: " + ret);
            Assert.assertEquals("test", ret);
        } catch (RemotingException e) {
            String errMsg = "RemotingException caught in testSyncPreHandle!";
            logger.error(errMsg, e);
            Assert.fail(errMsg);
        } catch (InterruptedException e) {
            String errMsg = "InterruptedException caught in testSyncPreHandle!";
            logger.error(errMsg, e);
            Assert.fail(errMsg);
        }

        Assert.assertTrue(serverPreHandlerResult[0]);
        Assert.assertTrue(serverPostHandlerResult[0]);
        Assert.assertTrue(clientPreHandlerResult[0]);
        Assert.assertTrue(clientPostHandlerResult[0]);
    }
@author chengyi (mark.lx@antfin.com) 2021-07-19 17:21
src/test/java/com/alipay/remoting/rpc/prehandle/ExtendHandlerTest.java