use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithClassThrowsWebApplicationExceptionTest.
/*
* @testName: optionsWithClassThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:1148; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1178;
*
* @test_Strategy: WebApplicationException - in case the response status code
* of the response returned by the server is not successful and the specified
* response type is not Response.
*/
@Test
public void optionsWithClassThrowsWebApplicationExceptionTest() throws Fault {
CompletionStageRxInvoker rx = startRxInvokerForMethod("optionsnotok");
Future<String> future = rx.options(String.class).toCompletableFuture();
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithStringClassTest.
/*
* @testName: methodWithStringClassTest
*
* @assertion_ids: JAXRS:JAVADOC:1142; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1172;
*
* @test_Strategy: Invoke an arbitrary method for the current request
*/
@Test
public void methodWithStringClassTest() throws Fault {
Future<String> future = null;
for (String method : METHODS) {
CompletionStageRxInvoker rx = startRxInvokerForMethod(method.toLowerCase() + "");
future = rx.method(method, String.class).toCompletableFuture();
checkFutureString(future, method);
}
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: getWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:1139; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1169;
*
* @test_Strategy: WebApplicationException - in case the response status code
* of the response returned by the server is not successful and the specified
* response type is not Response.
*/
@Test
public void getWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
CompletionStageRxInvoker rx = startRxInvokerForMethod("getnotok");
GenericType<Response> generic = createGeneric(Response.class);
Future<Response> future = rx.get(generic).toCompletableFuture();
checkFutureResponseStatus(future, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithGenericTypeWithEntityThrowsWebApplicationExceptionTest.
/*
* @testName: methodWithGenericTypeWithEntityThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:1146; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1176;
*
* @test_Strategy: WebApplicationException - in case the response status code
* of the response returned by the server is not successful and the specified
* response type is not Response.
*/
@Test
public void methodWithGenericTypeWithEntityThrowsWebApplicationExceptionTest() throws Fault {
Future<String> future = null;
GenericType<String> generic = createGeneric(String.class);
for (String method : ENTITY_METHODS) {
CompletionStageRxInvoker rx = startRxInvokerForMethod(method.toLowerCase() + "notok");
Entity<String> entity = Entity.entity(method, MediaType.WILDCARD_TYPE);
future = rx.method(method, entity, generic).toCompletableFuture();
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithGenericTypeResponseTest.
/*
* @testName: postWithGenericTypeResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:1152; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1182;
*
* @test_Strategy: Invoke HTTP post method for the current request
*/
@Test
public void postWithGenericTypeResponseTest() throws Fault {
GenericType<Response> generic = createGeneric(Response.class);
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
CompletionStageRxInvoker rx = startRxInvokerForMethod("post");
Future<Response> future = rx.post(entity, generic).toCompletableFuture();
checkFutureOkResponse(future);
}
Aggregations