@Test public void testUpdatedDetectorLastUsed() { Map<String, String> requestBody = Collections.singletonMap("detectorUuid", someUuid.toString()); controllerUnderTest.updatedDetectorLastUsed(requestBody); verify(detectorService, times(1)).updateDetectorLastUsed(someUuid.toString()); }
@PostMapping(path = "/updateDetectorLastUsed", consumes = "application/json", produces = "application/json") @ResponseStatus(HttpStatus.OK) public void updatedDetectorLastUsed(@RequestBody Map<String, String> params) { service.updateDetectorLastUsed(params.get("detectorUuid")); }
DetectorController { @PostMapping(path = "/updateDetectorLastUsed", consumes = "application/json", produces = "application/json") @ResponseStatus(HttpStatus.OK) public void updatedDetectorLastUsed(@RequestBody Map<String, String> params) { service.updateDetectorLastUsed(params.get("detectorUuid")); } }
DetectorController { @PostMapping(path = "/updateDetectorLastUsed", consumes = "application/json", produces = "application/json") @ResponseStatus(HttpStatus.OK) public void updatedDetectorLastUsed(@RequestBody Map<String, String> params) { service.updateDetectorLastUsed(params.get("detectorUuid")); }  }
DetectorController { @PostMapping(path = "/updateDetectorLastUsed", consumes = "application/json", produces = "application/json") @ResponseStatus(HttpStatus.OK) public void updatedDetectorLastUsed(@RequestBody Map<String, String> params) { service.updateDetectorLastUsed(params.get("detectorUuid")); }  @PostMapping @ResponseStatus(HttpStatus.CREATED) String createDetector(@Valid @RequestBody Detector detector, @RequestHeader HttpHeaders headers); @GetMapping(path = "/findByUuid", produces = "application/json") @ResponseStatus(HttpStatus.OK) Detector findByUuid(@RequestParam String uuid, @RequestHeader HttpHeaders headers); @GetMapping(path = "/findByCreatedBy", produces = "application/json") @ResponseStatus(HttpStatus.OK) List<Detector> findByCreatedBy(@RequestParam String user); @PostMapping(path = "/toggleDetector") @ResponseStatus(HttpStatus.OK) void toggleDetector(@RequestParam String uuid, @RequestParam Boolean enabled); @PostMapping(path = "/trustDetector") @ResponseStatus(HttpStatus.OK) void trustDetector(@RequestParam String uuid, @RequestParam Boolean trusted); @GetMapping(path = "/getLastUpdatedDetectors", produces = "application/json") @ResponseStatus(HttpStatus.OK) List<Detector> getLastUpdatedDetectors(@RequestParam long interval); @GetMapping(path = "/getLastUsedDetectors", produces = "application/json") @ResponseStatus(HttpStatus.OK) List<Detector> getLastUsedDetectors(@RequestParam int noOfDays); @PutMapping @ResponseStatus(HttpStatus.OK) void updateDetector(@RequestParam String uuid, @RequestBody Detector detector); @PostMapping(path = "/updateDetectorLastUsed", consumes = "application/json", produces = "application/json") @ResponseStatus(HttpStatus.OK) void updatedDetectorLastUsed(@RequestBody Map<String, String> params); @DeleteMapping @ResponseStatus(HttpStatus.OK) void deleteDetector(@RequestParam String uuid); @GetMapping(path = "/getDetectorsToTrain", produces = "application/json") @ResponseStatus(HttpStatus.OK) List<Detector> getDetectorsToTrain(@RequestParam Long timestampMs, @RequestHeader HttpHeaders headers); @PostMapping(path = "/updateDetectorTrainingTime") void updateDetectorTrainingTime(@RequestParam String uuid,
                                           @RequestParam Long nextRun,
                                           @RequestHeader HttpHeaders headers); }
DetectorController { @PostMapping(path = "/updateDetectorLastUsed", consumes = "application/json", produces = "application/json") @ResponseStatus(HttpStatus.OK) public void updatedDetectorLastUsed(@RequestBody Map<String, String> params) { service.updateDetectorLastUsed(params.get("detectorUuid")); }  @PostMapping @ResponseStatus(HttpStatus.CREATED) String createDetector(@Valid @RequestBody Detector detector, @RequestHeader HttpHeaders headers); @GetMapping(path = "/findByUuid", produces = "application/json") @ResponseStatus(HttpStatus.OK) Detector findByUuid(@RequestParam String uuid, @RequestHeader HttpHeaders headers); @GetMapping(path = "/findByCreatedBy", produces = "application/json") @ResponseStatus(HttpStatus.OK) List<Detector> findByCreatedBy(@RequestParam String user); @PostMapping(path = "/toggleDetector") @ResponseStatus(HttpStatus.OK) void toggleDetector(@RequestParam String uuid, @RequestParam Boolean enabled); @PostMapping(path = "/trustDetector") @ResponseStatus(HttpStatus.OK) void trustDetector(@RequestParam String uuid, @RequestParam Boolean trusted); @GetMapping(path = "/getLastUpdatedDetectors", produces = "application/json") @ResponseStatus(HttpStatus.OK) List<Detector> getLastUpdatedDetectors(@RequestParam long interval); @GetMapping(path = "/getLastUsedDetectors", produces = "application/json") @ResponseStatus(HttpStatus.OK) List<Detector> getLastUsedDetectors(@RequestParam int noOfDays); @PutMapping @ResponseStatus(HttpStatus.OK) void updateDetector(@RequestParam String uuid, @RequestBody Detector detector); @PostMapping(path = "/updateDetectorLastUsed", consumes = "application/json", produces = "application/json") @ResponseStatus(HttpStatus.OK) void updatedDetectorLastUsed(@RequestBody Map<String, String> params); @DeleteMapping @ResponseStatus(HttpStatus.OK) void deleteDetector(@RequestParam String uuid); @GetMapping(path = "/getDetectorsToTrain", produces = "application/json") @ResponseStatus(HttpStatus.OK) List<Detector> getDetectorsToTrain(@RequestParam Long timestampMs, @RequestHeader HttpHeaders headers); @PostMapping(path = "/updateDetectorTrainingTime") void updateDetectorTrainingTime(@RequestParam String uuid,
                                           @RequestParam Long nextRun,
                                           @RequestHeader HttpHeaders headers);  }