Interface TestEnvironment
-
- All Superinterfaces:
TestResource
- All Known Implementing Classes:
FlinkContainerTestEnvironment
,MiniClusterTestEnvironment
@Experimental public interface TestEnvironment extends TestResource
Test environment for running Flink jobs.The environment is bound with a Flink cluster, such as MiniCluster, Flink on container, or even a running session cluster.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TestEnvironment.Endpoint
Endpoint with address and port of the test environment.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StreamExecutionEnvironment
createExecutionEnvironment(TestEnvironmentSettings envOptions)
Get an instance ofStreamExecutionEnvironment
for building and executing Flink jobs based on the provided configuration.String
getCheckpointUri()
Get a path in string for storing checkpoint and savepoint in the test environment.TestEnvironment.Endpoint
getRestEndpoint()
Get endpoint of the test environment for connecting via REST API.-
Methods inherited from interface org.apache.flink.connector.testframe.TestResource
startUp, tearDown
-
-
-
-
Method Detail
-
createExecutionEnvironment
StreamExecutionEnvironment createExecutionEnvironment(TestEnvironmentSettings envOptions)
Get an instance ofStreamExecutionEnvironment
for building and executing Flink jobs based on the provided configuration.Note that this environment should be bound with the Flink cluster, because this will be the entrypoint to submit Flink jobs (via
StreamExecutionEnvironment.execute()
) in test cases.- Parameters:
envOptions
- options for the environment to satisfy
-
getRestEndpoint
TestEnvironment.Endpoint getRestEndpoint()
Get endpoint of the test environment for connecting via REST API.
-
getCheckpointUri
String getCheckpointUri()
Get a path in string for storing checkpoint and savepoint in the test environment.Note that testing framework may have no access to this storage (e.g. Flink cluster is on some cloud service and testing framework is executed locally). In test cases for testing failover scenario, this path will be passed to cluster client directly for triggering checkpoint / savepoint in this path and recovering from checkpoint / savepoint stored under this path.
-
-