Class TestKitSupport

Object
akka.javasdk.testkit.AsyncCallsSupport
akka.javasdk.testkit.TestKitSupport

@TestInstance(PER_CLASS) public abstract class TestKitSupport extends AsyncCallsSupport
This class provided the necessary infrastructure to run integration test for projects built with the Java SDK. Users should let their test classes extends this class.

This class wires-up a local service using the user's defined components.

Users can interact with their components via their public endpoint via an HTTP client or internally through the {{componentClient}}.

On test teardown, the service and the runtime will be stopped.

  • Field Details

    • testKit

      protected TestKit testKit
    • componentClient

      protected akka.javasdk.client.ComponentClient componentClient
    • timerScheduler

      protected akka.javasdk.timer.TimerScheduler timerScheduler
    • httpClient

      protected akka.javasdk.http.HttpClient httpClient
      A http client for interacting with the service under test, the client will not be authenticated and will appear to the service as a request with the internet principal.
  • Constructor Details

    • TestKitSupport

      public TestKitSupport()
  • Method Details

    • testKitSettings

      protected TestKit.Settings testKitSettings()
      Override this to use custom settings for an integration test
    • beforeAll

      @BeforeAll public void beforeAll()
    • afterAll

      @AfterAll public void afterAll()
    • getDependency

      public <T> T getDependency(Class<T> clazz)