@Test
    public void test() {
        ServerConfig serverConfig2 = new ServerConfig()
            .setPort(22222)
            .setDaemon(false);

        // ProviderConfig
        TestSyncFilter filter1 = new TestSyncFilter();
        ProviderConfig<HelloService> providerConfig = new ProviderConfig<HelloService>()
            .setInterfaceId(HelloService.class.getName())
            .setRef(new HelloServiceImpl(1000))
            .setFilterRef(Arrays.asList((Filter) filter1))
            .setApplication(new ApplicationConfig().setAppName("sss"))
            .setServer(serverConfig2);

        providerConfig.export();

        // ConsumerConfig
        TestSyncFilter filter0 = new TestSyncFilter();
        ConsumerConfig<HelloService> consumerConfig = new ConsumerConfig<HelloService>()
            .setInterfaceId(HelloService.class.getName())
            .setInvokeType(RpcConstants.INVOKER_TYPE_SYNC)
            .setApplication(new ApplicationConfig().setAppName("ccc"))
            .setTimeout(5000)
            .setFilterRef(Arrays.asList((Filter) filter0))
            .setDirectUrl("bolt://127.0.0.1:22222?appName=sss");
        HelloService helloService = consumerConfig.refer();

        try {
            helloService.sayHello("xxx", 12);
            // Consumer side
            Assert.assertEquals("xxx", filter0.args[0]);
            Assert.assertEquals(12, filter0.args[1]);
            Assert.assertEquals(HelloService.class.getName(), filter0.interfaceName);
            Assert.assertEquals("com.alipay.sofa.rpc.test.HelloService:1.0", filter0.targetServiceUniqueName);
            Assert.assertEquals("sayHello", filter0.methodName);
            Assert.assertEquals(RpcConstants.INVOKER_TYPE_SYNC, filter0.invokeType);
            Assert.assertNull(filter0.targetAppName);

            // Provider side
            Assert.assertEquals("xxx", filter1.args[0]);
            Assert.assertEquals(12, filter1.args[1]);
            Assert.assertEquals(HelloService.class.getName(), filter1.interfaceName);
            Assert.assertEquals("com.alipay.sofa.rpc.test.HelloService:1.0", filter1.targetServiceUniqueName);
            Assert.assertEquals("sayHello", filter1.methodName);
            Assert.assertEquals("sss", filter1.targetAppName);
        } catch (Exception e) {
        }
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
test/test-integration/src/test/java/com/alipay/sofa/rpc/filter/SyncFilterTest.java