private void securityServiceFailureTest() throws Exception {
    String msg = "@@security-service-expected@@";
    securityServiceFactory.exceptionToReturn = new IllegalStateException(msg);
    securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessRequest;
    verifyFailureWithMsg(msg);
    securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.PostProcessRequest;
    verifyFailureWithMsg(msg);
    securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessResponse;
    verifyFailureWithMsg(msg);

    securityServiceFactory.exceptionToThrow = new IllegalStateException(msg);
    securityServiceFactory.exceptionToReturn = null;
    securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessRequest;
    verifyFailureWithMsg(msg);
    securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.PostProcessRequest;
    verifyFailureWithMsg(msg);
    securityServiceFactory.mode = FrontendTestSecurityServiceFactory.Mode.ProcessResponse;
    verifyFailureWithMsg(msg);
    securityServiceFactory.exceptionToThrow = null;
  }
Tests the case where the {@link SecurityService} denies the request.
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/TtlUpdateHandlerTest.java