@Test @WithMockUser public void checkAlertsBackupRestoreRunning() { OffsetDateTime date = OffsetDateTime.now(ZoneOffset.UTC); AlertStatus alertStatus = new AlertStatus(); alertStatus.setBackupRestoreRunningSince(date); alertStatus.setCurrentTime(date); alertStatus.setGlobalConfValid(true); alertStatus.setSoftTokenPinEntered(true); when(notificationService.getAlerts()).thenReturn(alertStatus); ResponseEntity<AlertData> response = notificationsApiController.checkAlerts(); assertEquals(HttpStatus.OK, response.getStatusCode()); AlertData alertData = response.getBody(); assertEquals(alertStatus.getBackupRestoreRunningSince(), alertData.getBackupRestoreRunningSince()); assertEquals(alertStatus.getCurrentTime(), alertData.getCurrentTime()); assertEquals(alertStatus.getGlobalConfValid(), alertData.getGlobalConfValid()); assertEquals(alertStatus.getSoftTokenPinEntered(), alertData.getSoftTokenPinEntered()); }
@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; }