use of javax.ws.rs.client.AsyncInvoker in project jersey by jersey.
the class ClientInvocationTest method testMultipleAsyncInvokerCallsAsGenericTypeWithEntity.
@Test
public void testMultipleAsyncInvokerCallsAsGenericTypeWithEntity() throws Exception {
final AsyncInvoker request = target().request().async();
for (int i = 0; i < INVOCATIONS; i++) {
final String entity = "Message: " + i;
assertThat(request.post(Entity.text(entity), new GenericType<String>() {
}).get(), is(entity));
}
}
use of javax.ws.rs.client.AsyncInvoker in project jersey by jersey.
the class ClientInvocationTest method testMultipleAsyncInvokerCallsAsStringWithEntity.
@Test
public void testMultipleAsyncInvokerCallsAsStringWithEntity() throws Exception {
final AsyncInvoker request = target().request().async();
for (int i = 0; i < INVOCATIONS; i++) {
final String entity = "Message: " + i;
assertThat(request.post(Entity.text(entity), String.class).get(), is(entity));
}
}
use of javax.ws.rs.client.AsyncInvoker in project jersey by jersey.
the class ClientInvocationTest method testMultipleAsyncInvokerCallsWithEntity.
@Test
public void testMultipleAsyncInvokerCallsWithEntity() throws Exception {
final AsyncInvoker request = target().request().async();
for (int i = 0; i < INVOCATIONS; i++) {
final String entity = "Message: " + i;
assertThat(request.post(Entity.text(entity)).get().readEntity(String.class), is(entity));
}
}
use of javax.ws.rs.client.AsyncInvoker in project jersey by jersey.
the class RequestHeaderModificationsTest method testWarningLoggedAsync.
@Test
public void testWarningLoggedAsync() throws Exception {
AsyncInvoker asyncInvoker = requestBuilder().async();
Future<Response> responseFuture = asyncInvoker.post(requestEntity());
Response response = responseFuture.get();
assertResponse(response);
}
Aggregations