RestProtocol extends AbstractProxyProtocol { public RestProtocol() { super(WebApplicationException.class, ProcessingException.class); } RestProtocol(); void setHttpBinder(HttpBinder httpBinder); @Override int getDefaultPort(); @Override void destroy();  }
@Test public void testRestProtocol() { URL url = URL.valueOf("rest: DemoServiceImpl server = new DemoServiceImpl(); this.registerProvider(url, server, DemoService.class); Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, url)); Invoker<DemoService> invoker = protocol.refer(DemoService.class, url); Assertions.assertFalse(server.isCalled()); DemoService client = proxy.getProxy(invoker); String result = client.sayHello("haha"); Assertions.assertTrue(server.isCalled()); Assertions.assertEquals("Hello, haha", result); invoker.destroy(); exporter.unexport(); }