Package kalix.javasdk.testkit
Interface MockRegistry
public interface MockRegistry
This trait is meant to allow for unit testing when a service has cross-component or cross-service
calls. The set of mocks or stubs will be matched by its class type upon a call of an external
component or service.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MockRegistry
create()
Returns an empty instance of MockRegistry that can be chained with `withMock`<T> MockRegistry
Returns a new MockRegistry with the new mock added to previous ones.
-
Field Details
-
EMPTY
-
-
Method Details
-
withMock
Returns a new MockRegistry with the new mock added to previous ones.- Type Parameters:
T
- The service interface to be mocked.- Parameters:
clazz
- The class type used to identify the mock.instance
- The instance object to be used as a mock-- Returns:
- A copy of this MockRegistry.
-
create
Returns an empty instance of MockRegistry that can be chained with `withMock`- Returns:
- a new instance of MockRegistry
-