Search in sources :

Example 51 with CompletionStageRxInvoker

use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method traceWithGenericTypeThrowsProcessingExceptionTest.

/*
   * @testName: traceWithGenericTypeThrowsProcessingExceptionTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:1158; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1188;
   * 
   * @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 traceWithGenericTypeThrowsProcessingExceptionTest() throws Fault {
    _hostname = NONEXISTING_SITE;
    GenericType<String> generic = createGeneric(String.class);
    CompletionStageRxInvoker rx = startRxInvokerForMethod("trace");
    Future<String> future = rx.trace(generic).toCompletableFuture();
    assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
Also used : CompletionStageRxInvoker(jakarta.ws.rs.client.CompletionStageRxInvoker) Test(org.junit.jupiter.api.Test)

Example 52 with CompletionStageRxInvoker

use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method getTest.

// ------------------------------------------------------------------
// ---------------------------GET------------------------------------
// ------------------------------------------------------------------
/*
   * @testName: getTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:1137; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1167;
   * 
   * @test_Strategy: Invoke HTTP GET method for the current request
   */
@Test
public void getTest() throws Fault {
    CompletionStageRxInvoker rx = startRxInvokerForMethod("get");
    Future<Response> future = rx.get().toCompletableFuture();
    checkFutureOkResponse(future);
}
Also used : Response(jakarta.ws.rs.core.Response) CompletionStageRxInvoker(jakarta.ws.rs.client.CompletionStageRxInvoker) Test(org.junit.jupiter.api.Test)

Example 53 with CompletionStageRxInvoker

use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method methodWithGenericTypeStringTest.

/*
   * @testName: methodWithGenericTypeStringTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:1143; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1173;
   * 
   * @test_Strategy: Invoke an arbitrary method for the current request
   */
@Test
public void methodWithGenericTypeStringTest() throws Fault {
    GenericType<String> generic = createGeneric(String.class);
    Future<String> future = null;
    for (String method : METHODS) {
        CompletionStageRxInvoker rx = startRxInvokerForMethod(method.toLowerCase() + "");
        future = rx.method(method, generic).toCompletableFuture();
        checkFutureString(future, method);
    }
}
Also used : CompletionStageRxInvoker(jakarta.ws.rs.client.CompletionStageRxInvoker) Test(org.junit.jupiter.api.Test)

Example 54 with CompletionStageRxInvoker

use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method traceWithGenericTypeResponseTest.

/*
   * @testName: traceWithGenericTypeResponseTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:1158; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1188;
   * 
   * @test_Strategy: Invoke HTTP trace method for the current request
   */
@Test
public void traceWithGenericTypeResponseTest() throws Fault {
    GenericType<Response> generic = createGeneric(Response.class);
    CompletionStageRxInvoker rx = startRxInvokerForMethod("trace");
    Future<Response> future = rx.trace(generic).toCompletableFuture();
    checkFutureOkResponse(future);
}
Also used : Response(jakarta.ws.rs.core.Response) CompletionStageRxInvoker(jakarta.ws.rs.client.CompletionStageRxInvoker) Test(org.junit.jupiter.api.Test)

Example 55 with CompletionStageRxInvoker

use of jakarta.ws.rs.client.CompletionStageRxInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method methodWithGenericTypeResponseWithEntityTest.

/*
   * @testName: methodWithGenericTypeResponseWithEntityTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:1146; JAXRS:JAVADOC:1162; JAXRS:JAVADOC:1176;
   * 
   * @test_Strategy: Invoke an arbitrary method for the current request
   */
@Test
public void methodWithGenericTypeResponseWithEntityTest() throws Fault {
    Future<Response> future = null;
    GenericType<Response> generic = createGeneric(Response.class);
    for (String method : ENTITY_METHODS) {
        CompletionStageRxInvoker rx = startRxInvokerForMethod(method.toLowerCase() + "");
        Entity<String> entity = Entity.entity(method, MediaType.WILDCARD_TYPE);
        future = rx.method(method, entity, generic).toCompletableFuture();
        checkFutureOkResponse(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