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
    • modelProvidersByAgentId

      public final Map<String,akka.javasdk.agent.ModelProvider> modelProvidersByAgentId
  • 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. If not defined, the value from configuration key akka.javasdk.dev-mode.service-name will be used in the test.
      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

      @Deprecated(since="3.4.2", forRemoval=true) public TestKit.Settings withKeyValueEntityIncomingMessages(String componentId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Mock the incoming messages flow from a KeyValueEntity.
    • withKeyValueEntityIncomingMessages

      public TestKit.Settings withKeyValueEntityIncomingMessages(Class<? extends akka.javasdk.keyvalueentity.KeyValueEntity<?>> keyValueEntityClass)
    • withEventSourcedEntityIncomingMessages

      @Deprecated(since="3.4.2", forRemoval=true) public TestKit.Settings withEventSourcedEntityIncomingMessages(String componentId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Mock the incoming events flow from an EventSourcedEntity.
    • withEventSourcedEntityIncomingMessages

      public TestKit.Settings withEventSourcedEntityIncomingMessages(Class<? extends akka.javasdk.eventsourcedentity.EventSourcedEntity<?,?>> eventSourcedEntityClass)
    • withWorkflowIncomingMessages

      @Deprecated(since="3.4.2", forRemoval=true) public TestKit.Settings withWorkflowIncomingMessages(String componentId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Mock the incoming state updates flow from a Workflow.
    • withWorkflowIncomingMessages

      public TestKit.Settings withWorkflowIncomingMessages(Class<? extends akka.javasdk.workflow.Workflow<?>> workflowClass)
    • 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.
    • withAdditionalConfig

      public TestKit.Settings withAdditionalConfig(String 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.
    • withModelProvider

      public TestKit.Settings withModelProvider(Class<? extends akka.javasdk.agent.Agent> agentClass, akka.javasdk.agent.ModelProvider modelProvider)
    • toString

      public String toString()
      Overrides:
      toString in class Object