@Test @WithMockUser(authorities = {"DIAGNOSTICS"}) public void getOcspResponderDiagnosticsException() { when(diagnosticService.queryOcspResponderStatus()).thenThrow(new RuntimeException()); try { diagnosticsApiController.getOcspRespondersDiagnostics(); fail("should throw RuntimeException"); } catch (RuntimeException expected) { } }
@Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") public ResponseEntity<List<OcspResponderDiagnostics>> getOcspRespondersDiagnostics() { List<OcspResponderDiagnosticsStatus> statuses = diagnosticService.queryOcspResponderStatus(); return new ResponseEntity<>(ocspResponderDiagnosticConverter.convert(statuses), HttpStatus.OK); }
DiagnosticsApiController implements DiagnosticsApi { @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") public ResponseEntity<List<OcspResponderDiagnostics>> getOcspRespondersDiagnostics() { List<OcspResponderDiagnosticsStatus> statuses = diagnosticService.queryOcspResponderStatus(); return new ResponseEntity<>(ocspResponderDiagnosticConverter.convert(statuses), HttpStatus.OK); } }
DiagnosticsApiController implements DiagnosticsApi { @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") public ResponseEntity<List<OcspResponderDiagnostics>> getOcspRespondersDiagnostics() { List<OcspResponderDiagnosticsStatus> statuses = diagnosticService.queryOcspResponderStatus(); return new ResponseEntity<>(ocspResponderDiagnosticConverter.convert(statuses), HttpStatus.OK); } @Autowired  DiagnosticsApiController(DiagnosticService diagnosticService,
            GlobalConfDiagnosticConverter globalConfDiagnosticConverter,
            TimestampingServiceDiagnosticConverter timestampingServiceDiagnosticConverter,
            OcspResponderDiagnosticConverter ocspResponderDiagnosticConverter); }
DiagnosticsApiController implements DiagnosticsApi { @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") public ResponseEntity<List<OcspResponderDiagnostics>> getOcspRespondersDiagnostics() { List<OcspResponderDiagnosticsStatus> statuses = diagnosticService.queryOcspResponderStatus(); return new ResponseEntity<>(ocspResponderDiagnosticConverter.convert(statuses), HttpStatus.OK); } @Autowired  DiagnosticsApiController(DiagnosticService diagnosticService,
            GlobalConfDiagnosticConverter globalConfDiagnosticConverter,
            TimestampingServiceDiagnosticConverter timestampingServiceDiagnosticConverter,
            OcspResponderDiagnosticConverter ocspResponderDiagnosticConverter); @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") ResponseEntity<GlobalConfDiagnostics> getGlobalConfDiagnostics(); @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") ResponseEntity<List<TimestampingServiceDiagnostics>> getTimestampingServicesDiagnostics(); @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") ResponseEntity<List<OcspResponderDiagnostics>> getOcspRespondersDiagnostics(); }
DiagnosticsApiController implements DiagnosticsApi { @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") public ResponseEntity<List<OcspResponderDiagnostics>> getOcspRespondersDiagnostics() { List<OcspResponderDiagnosticsStatus> statuses = diagnosticService.queryOcspResponderStatus(); return new ResponseEntity<>(ocspResponderDiagnosticConverter.convert(statuses), HttpStatus.OK); } @Autowired  DiagnosticsApiController(DiagnosticService diagnosticService,
            GlobalConfDiagnosticConverter globalConfDiagnosticConverter,
            TimestampingServiceDiagnosticConverter timestampingServiceDiagnosticConverter,
            OcspResponderDiagnosticConverter ocspResponderDiagnosticConverter); @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") ResponseEntity<GlobalConfDiagnostics> getGlobalConfDiagnostics(); @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") ResponseEntity<List<TimestampingServiceDiagnostics>> getTimestampingServicesDiagnostics(); @Override @PreAuthorize("hasAuthority('DIAGNOSTICS')") ResponseEntity<List<OcspResponderDiagnostics>> getOcspRespondersDiagnostics();  }