private MockRestResponseChannel verifyOperationFailure(RestRequest restRequest, RestServiceErrorCode errorCode)
      throws Exception {
    MockRestResponseChannel restResponseChannel = new MockRestResponseChannel();
    try {
      doOperation(restRequest, restResponseChannel);
      fail("Operation should have failed");
    } catch (RestServiceException e) {
      assertEquals("Op should have failed with a specific error code", errorCode, e.getErrorCode());
    }
    return restResponseChannel;
  }
Verifies that the operation specified by {@code restRequest} fails with {@code errorCode}.
@param restRequest the {@link RestRequest} that should fail
@param errorCode the {@link RestServiceErrorCode} expected
@return the {@link MockRestResponseChannel} used for the operation
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/FrontendRestRequestServiceTest.java