@Test
  public void testMasterCoprocessorError() throws Throwable {
    Admin admin = util.getAdmin();
    TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface service =
      TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(admin.coprocessorService());
    try {
      service.error(null, TestProtos.EmptyRequestProto.getDefaultInstance());
      fail("Should have thrown an exception");
    } catch (ServiceException e) {
    }
  }
TestEndpoint: test cases to verify coprocessor Endpoint
hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java