Class MiniClusterWithClientResource

java.lang.Object
org.junit.rules.ExternalResource
org.apache.flink.runtime.testutils.MiniClusterResource
org.apache.flink.test.util.MiniClusterWithClientResource
All Implemented Interfaces:
org.junit.rules.TestRule

public class MiniClusterWithClientResource extends org.apache.flink.runtime.testutils.MiniClusterResource
Starts a Flink mini cluster as a resource and registers the StreamExecutionEnvironment.
  • Field Summary

    Fields inherited from class org.apache.flink.runtime.testutils.MiniClusterResource

    log
  • Constructor Summary

    Constructors
    Constructor
    Description
    MiniClusterWithClientResource(org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration miniClusterResourceConfiguration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    org.apache.flink.client.program.ClusterClient<?>
     
    org.apache.flink.client.program.rest.RestClusterClient<?>
    Returns a RestClusterClient that can be used to communicate with this mini cluster.
     

    Methods inherited from class org.apache.flink.runtime.testutils.MiniClusterResource

    cancelAllJobs, cancelAllJobsAndWaitUntilSlotsAreFreed, getClientConfiguration, getMiniCluster, getNumberSlots, getRestAddres, getRestAddress

    Methods inherited from class org.junit.rules.ExternalResource

    apply

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MiniClusterWithClientResource

      public MiniClusterWithClientResource(org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration miniClusterResourceConfiguration)
  • Method Details

    • getClusterClient

      public org.apache.flink.client.program.ClusterClient<?> getClusterClient()
    • getRestClusterClient

      public org.apache.flink.client.program.rest.RestClusterClient<?> getRestClusterClient() throws Exception
      Returns a RestClusterClient that can be used to communicate with this mini cluster. Only use this if the client returned via getClusterClient() does not fulfill your needs.
      Throws:
      Exception
    • getTestStreamEnvironment

      public TestStreamEnvironment getTestStreamEnvironment()
    • before

      public void before() throws Exception
      Overrides:
      before in class org.apache.flink.runtime.testutils.MiniClusterResource
      Throws:
      Exception
    • after

      public void after()
      Overrides:
      after in class org.apache.flink.runtime.testutils.MiniClusterResource