java.lang.Object
org.jboss.arquillian.testng.Arquillian
org.eclipse.microprofile.rest.client.tck.WiremockArquillianTest
org.eclipse.microprofile.rest.client.tck.asynctests.AsyncMethodTest
All Implemented Interfaces:
org.testng.IHookable, org.testng.ITestNGListener

public class AsyncMethodTest extends WiremockArquillianTest
Verifies via CDI injection that you can use a programmatic interface. verifies that the interface has Dependent scope. This test is the same as the CDIInvokeSimpleGetOperationTest but uses async methods.
  • Constructor Details

    • AsyncMethodTest

      public AsyncMethodTest()
  • Method Details

    • createDeployment

      @Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive createDeployment()
    • testInterfaceMethodWithCompletionStageResponseReturnIsInvokedAsynchronously

      public void testInterfaceMethodWithCompletionStageResponseReturnIsInvokedAsynchronously() throws Exception
      Tests that a Rest Client interface method that returns CompletionStage is invoked asychronously - checking that the thread ID of the response does not match the thread ID of the calling thread.
      Throws:
      Exception - - indicates test failure
    • testInterfaceMethodWithCompletionStageObjectReturnIsInvokedAsynchronously

      public void testInterfaceMethodWithCompletionStageObjectReturnIsInvokedAsynchronously() throws Exception
      Tests that a Rest Client interface method that returns a CompletionStage where it's parameterized type is some Object type other than Response) is invoked asychronously - checking that the thread ID of the response does not match the thread ID of the calling thread.
      Throws:
      Exception - - indicates test failure
    • testExecutorService

      public void testExecutorService() throws Exception
      Tests that the MP Rest Client implementation uses the specified ExecutorService.
      Throws:
      Exception - - indicates test failure
    • testAsyncInvocationInterceptorProvider

      public void testAsyncInvocationInterceptorProvider() throws Exception
      This test uses a ClientRequestFilter to update the destination URI. It attempts to update it based on a ThreadLocal object on the calling thread. It uses an AsyncInvocationInterceptorFactory provider to copy the ThreadLocal value from the calling thread to the async thread.
      Throws:
      Exception - - indicates test failure
    • testNullExecutorServiceThrowsIllegalArgumentException

      public void testNullExecutorServiceThrowsIllegalArgumentException()
      This test verifies that the RestClientBuilder implementation will throw an IllegalArgumentException when a null value is passed to the executorService method.
      Throws:
      IllegalArgumentException - - expected when passing null