Search in sources :

Example 86 with CompletionStageRxInvoker

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");
}
Also used : CompletionStageRxInvoker(jakarta.ws.rs.client.CompletionStageRxInvoker) Test(org.junit.jupiter.api.Test)

Example 87 with CompletionStageRxInvoker

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);
    }
}
Also used : Response(jakarta.ws.rs.core.Response) CompletionStageRxInvoker(jakarta.ws.rs.client.CompletionStageRxInvoker) Test(org.junit.jupiter.api.Test)

Example 88 with CompletionStageRxInvoker

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);
}
Also used : Response(jakarta.ws.rs.core.Response) CompletionStageRxInvoker(jakarta.ws.rs.client.CompletionStageRxInvoker) Test(org.junit.jupiter.api.Test)

Example 89 with CompletionStageRxInvoker

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);
}
Also used : Response(jakarta.ws.rs.core.Response) CompletionStageRxInvoker(jakarta.ws.rs.client.CompletionStageRxInvoker) Test(org.junit.jupiter.api.Test)

Example 90 with CompletionStageRxInvoker

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);
}
Also used : Response(jakarta.ws.rs.core.Response) CompletionStageRxInvoker(jakarta.ws.rs.client.CompletionStageRxInvoker) Test(org.junit.jupiter.api.Test)

Aggregations

CompletionStageRxInvoker (jakarta.ws.rs.client.CompletionStageRxInvoker)98 Test (org.junit.jupiter.api.Test)98 Response (jakarta.ws.rs.core.Response)51