use of javax.ws.rs.core.GenericType in project cxf by apache.
the class JAXRSClientServerResourceJacksonSpringProviderTest method testGetGenericSuperBookInt1.
@Test
public void testGetGenericSuperBookInt1() throws Exception {
String endpointAddress = "http://localhost:" + PORT + "/webapp/genericstoreInt1/int/books/superbook";
WebClient wc = WebClient.create(endpointAddress, Collections.singletonList(new JacksonJsonProvider()));
WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000000000L);
GenericType<List<SuperBook>> genericResponseType = new GenericType<List<SuperBook>>() {
};
List<SuperBook> books = wc.get(genericResponseType);
assertEquals(1, books.size());
assertEquals(111L, books.get(0).getId());
}
use of javax.ws.rs.core.GenericType in project cxf by apache.
the class JAXRSRxJava3FlowableTest method doTestGetHelloWorldJsonList.
private void doTestGetHelloWorldJsonList(String address) throws Exception {
WebClient wc = WebClient.create(address, Collections.singletonList(new JacksonJsonProvider()));
WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
GenericType<List<HelloWorldBean>> genericResponseType = new GenericType<List<HelloWorldBean>>() {
};
List<HelloWorldBean> beans = wc.accept("application/json").get(genericResponseType);
assertEquals(2, beans.size());
assertEquals("Hello", beans.get(0).getGreeting());
assertEquals("World", beans.get(0).getAudience());
assertEquals("Ciao", beans.get(1).getGreeting());
assertEquals("World", beans.get(1).getAudience());
}
use of javax.ws.rs.core.GenericType in project cxf by apache.
the class JAXRSRxJava3ObservableTest method doTestGetHelloWorldJsonList.
private void doTestGetHelloWorldJsonList(String address) throws Exception {
WebClient wc = WebClient.create(address, Collections.singletonList(new JacksonJsonProvider()));
WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
GenericType<List<HelloWorldBean>> genericResponseType = new GenericType<List<HelloWorldBean>>() {
};
List<HelloWorldBean> beans = wc.accept("application/json").get(genericResponseType);
assertEquals(2, beans.size());
assertEquals("Hello", beans.get(0).getGreeting());
assertEquals("World", beans.get(0).getAudience());
assertEquals("Ciao", beans.get(1).getGreeting());
assertEquals("World", beans.get(1).getAudience());
}
use of javax.ws.rs.core.GenericType in project cxf by apache.
the class JAXRSRxJava2FlowableTest method doTestGetHelloWorldJsonList.
private void doTestGetHelloWorldJsonList(String address) throws Exception {
WebClient wc = WebClient.create(address, Collections.singletonList(new JacksonJsonProvider()));
WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
GenericType<List<HelloWorldBean>> genericResponseType = new GenericType<List<HelloWorldBean>>() {
};
List<HelloWorldBean> beans = wc.accept("application/json").get(genericResponseType);
assertEquals(2, beans.size());
assertEquals("Hello", beans.get(0).getGreeting());
assertEquals("World", beans.get(0).getAudience());
assertEquals("Ciao", beans.get(1).getGreeting());
assertEquals("World", beans.get(1).getAudience());
}
use of javax.ws.rs.core.GenericType in project cxf by apache.
the class JAXRSRxJava2ObservableTest method doTestGetHelloWorldJsonList.
private void doTestGetHelloWorldJsonList(String address) throws Exception {
WebClient wc = WebClient.create(address, Collections.singletonList(new JacksonJsonProvider()));
WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000);
GenericType<List<HelloWorldBean>> genericResponseType = new GenericType<List<HelloWorldBean>>() {
};
List<HelloWorldBean> beans = wc.accept("application/json").get(genericResponseType);
assertEquals(2, beans.size());
assertEquals("Hello", beans.get(0).getGreeting());
assertEquals("World", beans.get(0).getAudience());
assertEquals("Ciao", beans.get(1).getGreeting());
assertEquals("World", beans.get(1).getAudience());
}
Aggregations