private static void negativeTestCase(String[] whitelistedPaths, String coprocessorPath)
    throws Exception {
    Configuration conf = UTIL.getConfiguration();
    conf.setInt("hbase.client.retries.number", 5);
    // load coprocessor under test
    conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
      CoprocessorWhitelistMasterObserver.class.getName());
    // set retries low to raise exception quickly
    // set a coprocessor whitelist path for test
    conf.setStrings(CoprocessorWhitelistMasterObserver.CP_COPROCESSOR_WHITELIST_PATHS_KEY,
      whitelistedPaths);
    UTIL.startMiniCluster();
    UTIL.createTable(TEST_TABLE, new byte[][] { TEST_FAMILY });
    UTIL.waitUntilAllRegionsAssigned(TEST_TABLE);
    Connection connection = ConnectionFactory.createConnection(conf);
    Admin admin = connection.getAdmin();
    // disable table so we do not actually try loading non-existant
    // coprocessor file
    admin.disableTable(TEST_TABLE);
    Table t = connection.getTable(TEST_TABLE);
    TableDescriptor htd = TableDescriptorBuilder.newBuilder(t.getDescriptor())
      .setCoprocessor(
        CoprocessorDescriptorBuilder.newBuilder("net.clayb.hbase.coprocessor.Whitelisted")
          .setJarPath(coprocessorPath).setPriority(Coprocessor.PRIORITY_USER).build())
      .build();
    LOG.info("Modifying Table");
    admin.modifyTable(htd);
    assertEquals(1, t.getDescriptor().getCoprocessorDescriptors().size());
    LOG.info("Done Modifying Table");
  }
Test a table modification adding a coprocessor path which is whitelisted. The coprocessor
should be added to the table descriptor successfully.
@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