use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithClassThrowsProcessingExceptionTest.
/*
* @testName: optionsWithClassThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:1148; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1178;
*
* @test_Strategy: ResponseProcessingException - in case processing of a
* received HTTP response fails (e.g. in a filter or during conversion of the
* response entity data to an instance of a particular Java type).
*/
@Test
public void optionsWithClassThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
CompletionStageRxInvoker rx = startRxInvokerForMethod("options");
Future<String> future = rx.options(String.class).toCompletableFuture();
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getWithGenericTypeThrowsWebApplicationExceptionTest.
/*
* @testName: getWithGenericTypeThrowsWebApplicationExceptionTest
*
* @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 getWithGenericTypeThrowsWebApplicationExceptionTest() throws Fault {
CompletionStageRxInvoker rx = startRxInvokerForMethod("getnotok");
GenericType<String> generic = createGeneric(String.class);
Future<String> future = rx.get(generic).toCompletableFuture();
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithResponseClassTest.
/*
* @testName: deleteWithResponseClassTest
*
* @assertion_ids: JAXRS:JAVADOC:1135; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1165;
*
* @test_Strategy: Invoke HTTP DELETE method for the current request
*
*/
@Test
public void deleteWithResponseClassTest() throws Fault {
CompletionStageRxInvoker rx = startRxInvokerForMethod("delete");
Future<Response> future = rx.delete(Response.class).toCompletableFuture();
checkFutureOkResponse(future);
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithClassThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: deleteWithClassThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:1135; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1165;
*
* @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 deleteWithClassThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
CompletionStageRxInvoker rx = startRxInvokerForMethod("deletenotok");
Future<Response> future = rx.delete(Response.class).toCompletableFuture();
checkFutureResponseStatus(future, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithResponseClassTest.
/*
* @testName: methodWithResponseClassTest
*
* @assertion_ids: JAXRS:JAVADOC:1142; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1172;
*
* @test_Strategy: Invoke an arbitrary method for the current request
*/
@Test
public void methodWithResponseClassTest() throws Fault {
Future<Response> future = null;
for (String method : METHODS) {
CompletionStageRxInvoker rx = startRxInvokerForMethod(method.toLowerCase() + "");
future = rx.method(method, Response.class).toCompletableFuture();
checkFutureOkResponse(future);
}
}
Aggregations