use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithGenericTypeThrowsProcessingExceptionTest.
/*
* @testName: putWithGenericTypeThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:1155; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1185;
*
* @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 putWithGenericTypeThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
GenericType<String> generic = createGeneric(String.class);
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
CompletionStageRxInvoker rx = startRxInvokerForMethod("put");
Future<String> future = rx.put(entity, generic).toCompletableFuture();
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithClassThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: putWithClassThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:1154; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1184;
*
* @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 putWithClassThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
CompletionStageRxInvoker rx = startRxInvokerForMethod("putnotok");
Future<Response> future = rx.put(entity, 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 methodThrowsProcessingExceptionTest.
/*
* @testName: methodThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:1141; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1171;
*
* @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 methodThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
Future<Response> future = null;
for (String method : METHODS) {
CompletionStageRxInvoker rx = startRxInvokerForMethod(method.toLowerCase());
future = rx.method(method).toCompletableFuture();
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithStringClassTest.
/*
* @testName: putWithStringClassTest
*
* @assertion_ids: JAXRS:JAVADOC:1154; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1184;
*
* @test_Strategy: Invoke HTTP put method for the current request
*/
@Test
public void putWithStringClassTest() throws Fault {
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
CompletionStageRxInvoker rx = startRxInvokerForMethod("put");
Future<String> future = rx.put(entity, String.class).toCompletableFuture();
checkFutureString(future, "put");
}
use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithClassThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: methodWithClassThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:1142; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1172;
*
* @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 methodWithClassThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
Future<Response> future = null;
for (String method : METHODS) {
CompletionStageRxInvoker rx = startRxInvokerForMethod(method.toLowerCase() + "notok");
future = rx.method(method, Response.class).toCompletableFuture();
checkFutureResponseStatus(future, Status.NOT_ACCEPTABLE);
}
}
Aggregations