use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithStringClassTest.
/*
* @testName: optionsWithStringClassTest
*
* @assertion_ids: JAXRS:JAVADOC:1148; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1178;
*
* @test_Strategy: Invoke HTTP options method for the current request
*/
@Test
public void optionsWithStringClassTest() throws Fault {
CompletionStageRxInvoker rx = startRxInvokerForMethod("options");
Future<String> future = rx.options(String.class).toCompletableFuture();
checkFutureString(future, "options");
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodTest.
// ------------------------------------------------------------------
// ---------------------------METHOD-----------------------------------
// ------------------------------------------------------------------
/*
* @testName: methodTest
*
* @assertion_ids: JAXRS:JAVADOC:1141; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1171;
*
* @test_Strategy: Invoke an arbitrary method for the current request
*/
@Test
public void methodTest() throws Fault {
Future<Response> future = null;
for (String method : METHODS) {
CompletionStageRxInvoker rx = startRxInvokerForMethod(method.toLowerCase() + "");
future = rx.method(method).toCompletableFuture();
checkFutureOkResponse(future);
}
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithResponseClassTest.
/*
* @testName: optionsWithResponseClassTest
*
* @assertion_ids: JAXRS:JAVADOC:1148; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1178;
*
* @test_Strategy: Invoke HTTP options method for the current request
*/
@Test
public void optionsWithResponseClassTest() throws Fault {
CompletionStageRxInvoker rx = startRxInvokerForMethod("options");
Future<Response> future = rx.options(Response.class).toCompletableFuture();
checkFutureOkResponse(future);
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName:
* traceWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:1158; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1188;
*
* @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 traceWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
CompletionStageRxInvoker rx = startRxInvokerForMethod("tracenotok");
GenericType<Response> generic = createGeneric(Response.class);
Future<Response> future = rx.trace(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 deleteThrowsExceptionTest.
/*
* @testName: deleteThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:1134; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1164;
*
* @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 deleteThrowsExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
CompletionStageRxInvoker rx = startRxInvokerForMethod("delete");
Future<Response> future = rx.delete().toCompletableFuture();
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
Aggregations