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 ClassesModifier and TypeInterfaceDescriptionstatic classMockCallArgs for use in CallAsyncstatic classResourceArgs for use innewResourceAsync(ResourceArgs)static classA resource identifier and resource state. -
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture<Map<String,Object>> callAsync(Mocks.CallArgs args) Invoked when the program needs to call a provider to load data (e.g., to retrieve an existing resource).Invoked when a new resource is created by the program.
-
Method Details
-
newResourceAsync
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
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.
-