Package com.pulumi.test
Interface PulumiTest
-
- All Known Implementing Classes:
PulumiTestInternal
public interface PulumiTest
Provides a test Pulumi runner and exposes various internals for the testing purposes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
PulumiTest.API
Pulumi test entrypoint operations.
-
Method Summary
Static Methods Modifier and Type Method Description static void
cleanup()
Cleanup internal test state.static <T> T
extractValue(Output<T> output)
Extract the value from anOutput
blocking.static <T> java.util.concurrent.CompletableFuture<T>
extractValueAsync(Output<T> output)
Extract the future value from anOutput
asynchronously.static TestResult
runTest(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.API
withMocks(Mocks mocks)
UseMocks
in this test.static PulumiTest.API
withOptions(TestOptions options)
UseTestOptions
in 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
TestResult
from 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
TestResult
from Pulumi test runtime after running the stack - See Also:
runTest(Consumer)
,withOptions(TestOptions)
,withMocks(Mocks)
-
withOptions
static PulumiTest.API withOptions(TestOptions options)
UseTestOptions
in this test.- Parameters:
options
- theTestOptions
to 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)
UseMocks
in this test.- Parameters:
mocks
- theMonitor
mocks 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 anOutput
blocking.
-
-