Package com.pulumi.test
Interface PulumiTest
-
- All Known Implementing Classes:
PulumiTestInternal
public interface PulumiTestProvides a test Pulumi runner and exposes various internals for the testing purposes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePulumiTest.APIPulumi test entrypoint operations.
-
Method Summary
Static Methods Modifier and Type Method Description static voidcleanup()Cleanup internal test state.static <T> TextractValue(Output<T> output)Extract the value from anOutputblocking.static <T> java.util.concurrent.CompletableFuture<T>extractValueAsync(Output<T> output)Extract the future value from anOutputasynchronously.static TestResultrunTest(java.util.function.Consumer<Context> stack)Run a Pulumi test stack callback, wait for result and returnTestResult.static java.util.concurrent.CompletableFuture<TestResult>runTestAsync(java.util.function.Consumer<Context> stack)Run a Pulumi test stack callback asynchronously and returnTestResult.static PulumiTest.APIwithMocks(Mocks mocks)UseMocksin this test.static PulumiTest.APIwithOptions(TestOptions options)UseTestOptionsin this test.
-
-
-
Method Detail
-
runTest
static TestResult runTest(java.util.function.Consumer<Context> stack)
Run a Pulumi test stack callback, wait for result and returnTestResult.- Parameters:
stack- the stack to run in Pulumi test runtime- Returns:
- a
TestResultfrom Pulumi test runtime after running the stack - See Also:
runTestAsync(Consumer),withOptions(TestOptions),withMocks(Mocks)
-
runTestAsync
static java.util.concurrent.CompletableFuture<TestResult> runTestAsync(java.util.function.Consumer<Context> stack)
Run a Pulumi test stack callback asynchronously and returnTestResult.- Parameters:
stack- the stack to run in Pulumi test runtime- Returns:
- a future
TestResultfrom Pulumi test runtime after running the stack - See Also:
runTest(Consumer),withOptions(TestOptions),withMocks(Mocks)
-
withOptions
static PulumiTest.API withOptions(TestOptions options)
UseTestOptionsin this test.- Parameters:
options- theTestOptionsto use- Returns:
- a Pulumi test program entrypoint with given
TestOptions - See Also:
runTest(Consumer),runTestAsync(Consumer),withMocks(Mocks)
-
withMocks
static PulumiTest.API withMocks(Mocks mocks)
UseMocksin this test.- Parameters:
mocks- theMonitormocks to use- Returns:
- a Pulumi test program entrypoint with given
TestOptions - See Also:
runTest(Consumer),runTestAsync(Consumer),withOptions(TestOptions)
-
cleanup
static void cleanup()
Cleanup internal test state. Must be called after every run of a Pulumi test program.
-
extractValue
@Nullable static <T> T extractValue(Output<T> output)
Extract the value from anOutputblocking.
-
-