private void testExceptionCasesProcessResponse(RestMethod restMethod, RestResponseChannel restResponseChannel,
      BlobInfo blobInfo, RestServiceErrorCode expectedErrorCode) throws Exception {
    ThrowingConsumer<ExecutionException> errorAction = e -> {
      Assert.assertTrue("Exception should have been an instance of RestServiceException",
          e.getCause() instanceof RestServiceException);
      RestServiceException re = (RestServiceException) e.getCause();
      Assert.assertEquals("Unexpected RestServerErrorCode (Future)", expectedErrorCode, re.getErrorCode());
    };
    RestRequest restRequest = createRestRequest(restMethod, "/", null);
    TestUtils.assertException(ExecutionException.class,
        () -> securityService.processResponse(restRequest, restResponseChannel, blobInfo).get(), errorAction);
  }
Tests exception cases for
{@link SecurityService#processResponse(RestRequest, RestResponseChannel, BlobInfo, Callback)}
@param restMethod the {@link RestMethod} of the request to be made
@param restResponseChannel the {@link RestResponseChannel} to write responses over.
@param blobInfo the {@link BlobInfo} to be used for the {@link RestRequest}
@param expectedErrorCode the {@link RestServiceErrorCode} expected in the exception returned.
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/AmbrySecurityServiceTest.java