Package com.pulumi.test
Interface Mocks
-
- All Known Implementing Classes:
EmptyMocks
public interface Mocks
Hooks to mock the engine that provide test doubles for offline unit testing of stacks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Mocks.CallArgs
MockCallArgs for use in CallAsyncstatic class
Mocks.ResourceArgs
ResourceArgs for use innewResourceAsync(ResourceArgs)
static class
Mocks.ResourceResult
A resource identifier and resource state.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>>
callAsync(Mocks.CallArgs args)
Invoked when the program needs to call a provider to load data (e.g., to retrieve an existing resource).java.util.concurrent.CompletableFuture<Mocks.ResourceResult>
newResourceAsync(Mocks.ResourceArgs args)
Invoked when a new resource is created by the program.
-
-
-
Method Detail
-
newResourceAsync
java.util.concurrent.CompletableFuture<Mocks.ResourceResult> newResourceAsync(Mocks.ResourceArgs args)
Invoked when a new resource is created by the program.- Parameters:
args
- arguments containing resource information- Returns:
- A resource identifier and resource state. State can be either a POJO or a dictionary bag. The returned ID may be null for component resources.
-
callAsync
default java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>> callAsync(Mocks.CallArgs args)
Invoked when the program needs to call a provider to load data (e.g., to retrieve an existing resource).Default implementation returns an empty map.
- Parameters:
args
- arguments containing call information- Returns:
- the call invocation result, can be either a POCO or a dictionary bag.
-
-