@Test
    public void testProvider() {
        JAXRSProviderManager.registerCustomProviderInstance(new CustomerInjectorFactory());
        JAXRSProviderManager.registerCustomProviderInstance(new ClientRequestTestFilter());
        JAXRSProviderManager.registerCustomProviderInstance(new ClientRequestTestFilter2());
        JAXRSProviderManager.registerCustomProviderInstance(new ContainerRequestTestFilter());
        JAXRSProviderManager.registerCustomProviderInstance(new ContainerResponseTestFilter());
        JAXRSProviderManager.registerCustomProviderInstance(new ClientResponseTestFilter());

        ServerConfig serverConfig = new ServerConfig()
            .setStopTimeout(60000)
            .setPort(8803)
            .setProtocol(RpcConstants.PROTOCOL_TYPE_REST);

        ProviderConfig<RestService> providerConfig = new ProviderConfig<RestService>()
            .setInterfaceId(RestService.class.getName())
            .setRef(new RestServiceImpl())
            .setServer(serverConfig)
            .setBootstrap("rest")
            .setRegister(false);
        providerConfig.export();

        ConsumerConfig<RestService> consumerConfig = new ConsumerConfig<RestService>()
            .setInterfaceId(RestService.class.getName())
            .setDirectUrl("rest://127.0.0.1:8803")
            .setProtocol("rest")
            .setBootstrap("rest")
            .setTimeout(30000)
            .setRegister(false)
            .setFilter(Arrays.asList("-*"))
            .setApplication(new ApplicationConfig().setAppName("TestClient"));
        RestService restService = consumerConfig.refer();

        Assert.assertEquals("serverok", restService.get("ok"));

        String nameA = ClientRequestTestFilter.getName();
        String nameA2 = ClientRequestTestFilter2.getName();
        String nameB = ContainerRequestTestFilter.getName();
        String nameC = ContainerResponseTestFilter.getName();
        String nameD = ClientResponseTestFilter.getName();
        Assert.assertEquals("AtestInjecttestInject", nameA);
        Assert.assertEquals("A2", nameA2);
        Assert.assertEquals("B", nameB);
        Assert.assertEquals("C", nameC);
        Assert.assertEquals("D", nameD);

    }
@author <a href="mailto:lw111072@antfin.com">liangen</a>
test/test-integration/src/test/java/com/alipay/sofa/rpc/server/rest/RestProviderTest.java