JAXRSClientFactoryBean cfb = (JAXRSClientFactoryBean) bean;
Bus bus = cfb.getBus();
ClientLifeCycleManager manager = bus.getExtension(ClientLifeCycleManager.class);
TestClientLifeCycleListener listener = new TestClientLifeCycleListener();
manager.registerListener(listener);
BookStore bs = cfb.create(BookStore.class);
assertNotNull(listener.getEp());
assertEquals("{http://service.rs}BookService",
listener.getEp().getEndpointInfo().getName().toString());
assertEquals("https://localhost:" + PORT, WebClient.client(bs).getBaseURI().toString());
Book b = bs.getSecureBook("123");
assertEquals(b.getId(), 123);
b = bs.getSecureBook("123");
assertEquals(b.getId(), 123);
ctx.close();
}