@Test
  public void testReadOnlyConfiguration() throws Exception {
    Configuration conf = new Configuration(CONF);
    HRegion region = mock(HRegion.class);
    when(region.getRegionInfo()).thenReturn(REGIONINFO);
    when(region.getTableDescriptor()).thenReturn(TABLEDESC);
    RegionServerServices rsServices = mock(RegionServerServices.class);
    RegionCoprocessorHost rcp = new RegionCoprocessorHost(region, rsServices, conf);
    boolean found = false;
    for (String cpStr : rcp.getCoprocessors()) {
      CoprocessorEnvironment cpenv = rcp.findCoprocessorEnvironment(cpStr);
      if (cpenv != null) {
        found = true;
      }
      Configuration c = cpenv.getConfiguration();
      thrown.expect(UnsupportedOperationException.class);
      c.set("one.two.three", "four.five.six");
    }
    assertTrue("Should be at least one CP found", found);
  }
Rough test that Coprocessor Environment is Read-Only. Just check a random CP and see that it
returns a read-only config.
hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorConfiguration.java