我可以帮您翻译成中文。以下是您提供的控制器代码:
我有以下控制器:
class Controller {
@ResponseStatus(HttpStatus.OK)
@RequestMapping(value = "/verifyCert", method = RequestMethod.GET)
public void verifyCertificate() throws CertificateExpiredException, CertificateNotYetValidException {
certificate.checkValidity();
}
@ResponseStatus(HttpStatus.FORBIDDEN)
@ExceptionHandler({CertificateExpiredException.class, CertificateNotYetValidException.class})
public void handleCertificateValidityException(Exception e) {}
}
我的目标是,如果证书无效,控制器将重定向到异常处理程序。
standaloneSetup
ψIJφüΞ〴εÖΕδΜ•MockMvcBuilders
φ•Ιφ≥ïψIJ - Sotirios Delimanolis