private static void positiveTestCase(String[] whitelistedPaths, String coprocessorPath)
    throws Exception {
    Configuration conf = UTIL.getConfiguration();
    // load coprocessor under test
    conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
      CoprocessorWhitelistMasterObserver.class.getName());
    conf.setStrings(CoprocessorWhitelistMasterObserver.CP_COPROCESSOR_WHITELIST_PATHS_KEY,
      whitelistedPaths);
    // set retries low to raise exception quickly
    conf.setInt("hbase.client.retries.number", 5);
    UTIL.startMiniCluster();
    UTIL.createTable(TEST_TABLE, new byte[][] { TEST_FAMILY });
    UTIL.waitUntilAllRegionsAssigned(TEST_TABLE);
    Connection connection = ConnectionFactory.createConnection(conf);
    Table t = connection.getTable(TEST_TABLE);
    TableDescriptor htd = TableDescriptorBuilder.newBuilder(t.getDescriptor())
      .setCoprocessor(
        CoprocessorDescriptorBuilder.newBuilder("net.clayb.hbase.coprocessor.NotWhitelisted")
          .setJarPath(coprocessorPath).setPriority(Coprocessor.PRIORITY_USER).build())
      .build();
    LOG.info("Modifying Table");
    try {
      connection.getAdmin().modifyTable(htd);
      fail("Expected coprocessor to raise IOException");
    } catch (IOException e) {
      // swallow exception from coprocessor
    }
    LOG.info("Done Modifying Table");
    assertEquals(0, t.getDescriptor().getCoprocessorDescriptors().size());
  }
Test a table modification adding a coprocessor path which is not whitelisted.
@exception Exception should be thrown and caught to show coprocessor is working as desired
@param whitelistedPaths A String array of paths to add in for the whitelisting configuration
@param coprocessorPath  A String to use as the path for a mock coprocessor
hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestCoprocessorWhitelistMasterObserver.java