Class ConnectionRule

java.lang.Object
org.junit.rules.ExternalResource
org.apache.hadoop.hbase.ConnectionRule
All Implemented Interfaces:
org.junit.rules.TestRule

public final class ConnectionRule extends org.junit.rules.ExternalResource
A Rule that manages the lifecycle of an instance of AsyncConnection. Can be used in either the Rule or ClassRule positions.

Use in combination with MiniClusterRule, for example:
 {
   @code
   public class TestMyClass {
     private static final MiniClusterRule miniClusterRule = MiniClusterRule.newBuilder().build();
     private static final ConnectionRule connectionRule =
       ConnectionRule.createAsyncConnectionRule(miniClusterRule::createConnection);

     @ClassRule
     public static final TestRule rule =
       RuleChain.outerRule(miniClusterRule).around(connectionRule);
   }
 }