
com.pulumi.test.Mocks Maven / Gradle / Ivy
package com.pulumi.test;
import com.google.common.collect.ImmutableMap;
import javax.annotation.Nullable;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import static java.util.Objects.requireNonNull;
/**
* Hooks to mock the engine that provide test doubles for offline unit testing of stacks.
*/
public interface Mocks {
/**
* Invoked when a new resource is created by the program.
*
*
* @param args arguments containing resource information
* @return 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.
*/
CompletableFuture newResourceAsync(ResourceArgs 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.
*
* @param args arguments containing call information
* @return the call invocation result, can be either a POCO or a dictionary bag.
*/
default CompletableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy