@Test @WithMockUser public void checkAlertsSoftTokenNotFound() { doThrow(new RuntimeException("")).when(notificationService).getAlerts(); try { ResponseEntity<AlertData> response = notificationsApiController.checkAlerts(); fail("should throw RuntimeException"); } catch (RuntimeException expected) { } }
@GetMapping(value = "/alerts", produces = { "application/json" }) public ResponseEntity<AlertData> checkAlerts() { AlertStatus alertStatus = notificationService.getAlerts(); return new ResponseEntity<>(alertDataConverter.convert(alertStatus), HttpStatus.OK); }
NotificationsApiController { @GetMapping(value = "/alerts", produces = { "application/json" }) public ResponseEntity<AlertData> checkAlerts() { AlertStatus alertStatus = notificationService.getAlerts(); return new ResponseEntity<>(alertDataConverter.convert(alertStatus), HttpStatus.OK); } }
NotificationsApiController { @GetMapping(value = "/alerts", produces = { "application/json" }) public ResponseEntity<AlertData> checkAlerts() { AlertStatus alertStatus = notificationService.getAlerts(); return new ResponseEntity<>(alertDataConverter.convert(alertStatus), HttpStatus.OK); } @Autowired  NotificationsApiController(
            NotificationService notificationService, AlertDataConverter alertDataConverter); }
NotificationsApiController { @GetMapping(value = "/alerts", produces = { "application/json" }) public ResponseEntity<AlertData> checkAlerts() { AlertStatus alertStatus = notificationService.getAlerts(); return new ResponseEntity<>(alertDataConverter.convert(alertStatus), HttpStatus.OK); } @Autowired  NotificationsApiController(
            NotificationService notificationService, AlertDataConverter alertDataConverter); @GetMapping(value = "/session-status", produces = { "application/json" }) ResponseEntity<StatusData> isSessionAlive(HttpServletRequest request); @GetMapping(value = "/alerts", produces = { "application/json" }) ResponseEntity<AlertData> checkAlerts(); @PreAuthorize("hasAnyAuthority('BACKUP_CONFIGURATION', 'RESTORE_CONFIGURATION')") @PutMapping(value = "/alerts/reset") ResponseEntity<Void> resetBackupRestoreRunningSince(); }
NotificationsApiController { @GetMapping(value = "/alerts", produces = { "application/json" }) public ResponseEntity<AlertData> checkAlerts() { AlertStatus alertStatus = notificationService.getAlerts(); return new ResponseEntity<>(alertDataConverter.convert(alertStatus), HttpStatus.OK); } @Autowired  NotificationsApiController(
            NotificationService notificationService, AlertDataConverter alertDataConverter); @GetMapping(value = "/session-status", produces = { "application/json" }) ResponseEntity<StatusData> isSessionAlive(HttpServletRequest request); @GetMapping(value = "/alerts", produces = { "application/json" }) ResponseEntity<AlertData> checkAlerts(); @PreAuthorize("hasAnyAuthority('BACKUP_CONFIGURATION', 'RESTORE_CONFIGURATION')") @PutMapping(value = "/alerts/reset") ResponseEntity<Void> resetBackupRestoreRunningSince(); static final String NOTIFICATIONS_API_V1_PATH; }