Class TestKit.Settings

Object
akka.javasdk.testkit.TestKit.Settings
Enclosing class:
TestKit

public static class TestKit.Settings extends Object
Settings for testkit.
  • Field Details

    • DEFAULT

      public static TestKit.Settings DEFAULT
      Default settings for testkit.
    • serviceName

      public final String serviceName
      The name of this service when deployed.
    • aclEnabled

      public final boolean aclEnabled
      Whether ACL checking is enabled.
    • eventingSupport

      public final TestKit.Settings.EventingSupport eventingSupport
    • mockedEventing

      public final TestKit.MockedEventing mockedEventing
    • additionalConfig

      public final com.typesafe.config.Config additionalConfig
    • dependencyProvider

      public final Optional<akka.javasdk.DependencyProvider> dependencyProvider
    • disabledComponents

      public final Set<Class<?>> disabledComponents
  • Method Details

    • withServiceName

      public TestKit.Settings withServiceName(String serviceName)
      Set the name of this service. This will be used by the service when making calls on other services run by the testkit to authenticate itself, allowing those services to apply ACLs based on that name.
      Parameters:
      serviceName - The name of this service.
      Returns:
      The updated settings.
    • withAclDisabled

      public TestKit.Settings withAclDisabled()
      Disable ACL checking in this service.
      Returns:
      The updated settings.
    • withAclEnabled

      public TestKit.Settings withAclEnabled()
      Enable ACL checking in this service (this is the default).
      Returns:
      The updated settings.
    • withKeyValueEntityIncomingMessages

      public TestKit.Settings withKeyValueEntityIncomingMessages(String typeId)
      Mock the incoming messages flow from a KeyValueEntity.
    • withEventSourcedEntityIncomingMessages

      public TestKit.Settings withEventSourcedEntityIncomingMessages(String typeId)
      Mock the incoming events flow from an EventSourcedEntity.
    • withStreamIncomingMessages

      public TestKit.Settings withStreamIncomingMessages(String service, String streamId)
      Mock the incoming messages flow from a Stream (eventing.in.direct in case of protobuf SDKs).
    • withTopicIncomingMessages

      public TestKit.Settings withTopicIncomingMessages(String topic)
      Mock the incoming events flow from a Topic.
    • withTopicOutgoingMessages

      public TestKit.Settings withTopicOutgoingMessages(String topic)
      Mock the outgoing events flow for a Topic.
    • withEventingSupport

      public TestKit.Settings withEventingSupport(TestKit.Settings.EventingSupport eventingSupport)
    • withAdditionalConfig

      public TestKit.Settings withAdditionalConfig(com.typesafe.config.Config additionalConfig)
      Specify additional config that will override the application-test.conf or application.conf configuration in a particular test.
    • withDependencyProvider

      public TestKit.Settings withDependencyProvider(akka.javasdk.DependencyProvider dependencyProvider)
      Set a dependency provider that will be used for looking up arbitrary dependencies, useful to provide mocks for production dependencies in tests rather than calling the real thing.
    • withDisabledComponents

      public TestKit.Settings withDisabledComponents(Set<Class<?>> disabledComponents)
      Disable components from running, useful for testing components in isolation. This set of disabled components will be added to ServiceSetup.disabledComponents() if configured.
    • toString

      public String toString()
      Overrides:
      toString in class Object