Package akka.javasdk.testkit
Class TestKit.Settings
Object
akka.javasdk.testkit.TestKit.Settings
- Enclosing class:
TestKit
Settings for testkit.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal boolean
Whether ACL checking is enabled.final com.typesafe.config.Config
static TestKit.Settings
Default settings for testkit.final Optional
<akka.javasdk.DependencyProvider> final TestKit.MockedEventing
final String
The name of this service when deployed. -
Method Summary
Modifier and TypeMethodDescriptiontoString()
Disable ACL checking in this service.Enable ACL checking in this service (this is the default).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
(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
(Set<Class<?>> disabledComponents) Disable components from running, useful for testing components in isolation.withEventingSupport
(TestKit.Settings.EventingSupport eventingSupport) Mock the incoming events flow from an EventSourcedEntity.Mock the incoming messages flow from a KeyValueEntity.withServiceName
(String serviceName) Set the name of this service.withStreamIncomingMessages
(String service, String streamId) Mock the incoming messages flow from a Stream (eventing.in.direct in case of protobuf SDKs).withTopicIncomingMessages
(String topic) Mock the incoming events flow from a Topic.withTopicOutgoingMessages
(String topic) Mock the outgoing events flow for a Topic.
-
Field Details
-
DEFAULT
Default settings for testkit. -
serviceName
The name of this service when deployed. -
aclEnabled
public final boolean aclEnabledWhether ACL checking is enabled. -
eventingSupport
-
mockedEventing
-
additionalConfig
public final com.typesafe.config.Config additionalConfig -
dependencyProvider
-
disabledComponents
-
-
Method Details
-
withServiceName
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
Disable ACL checking in this service.- Returns:
- The updated settings.
-
withAclEnabled
Enable ACL checking in this service (this is the default).- Returns:
- The updated settings.
-
withKeyValueEntityIncomingMessages
Mock the incoming messages flow from a KeyValueEntity. -
withEventSourcedEntityIncomingMessages
Mock the incoming events flow from an EventSourcedEntity. -
withStreamIncomingMessages
Mock the incoming messages flow from a Stream (eventing.in.direct in case of protobuf SDKs). -
withTopicIncomingMessages
Mock the incoming events flow from a Topic. -
withTopicOutgoingMessages
Mock the outgoing events flow for a Topic. -
withEventingSupport
-
withAdditionalConfig
Specify additional config that will override the application-test.conf or application.conf configuration in a particular test. -
withDependencyProvider
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
Disable components from running, useful for testing components in isolation. This set of disabled components will be added toServiceSetup.disabledComponents()
if configured. -
toString
-