@Test void testDeactivateApp() throws Exception { App app = mock(App.class); when(dataService.findOneById(AppMetadata.APP, "id", App.class)).thenReturn(app); mockMvc.perform(post(AppManagerController.URI + "/deactivate/id")).andExpect(status().is(200)); verify(app).setActive(false); verify(dataService).update(AppMetadata.APP, app); }
@ResponseStatus(HttpStatus.OK) @PostMapping("/deactivate/{id}") public void deactivateApp(@PathVariable(value = "id") String id) { App app = getApp(id); app.setActive(false); dataService.update(AppMetadata.APP, app); }
AppManagerController extends PluginController { @ResponseStatus(HttpStatus.OK) @PostMapping("/deactivate/{id}") public void deactivateApp(@PathVariable(value = "id") String id) { App app = getApp(id); app.setActive(false); dataService.update(AppMetadata.APP, app); } }
AppManagerController extends PluginController { @ResponseStatus(HttpStatus.OK) @PostMapping("/deactivate/{id}") public void deactivateApp(@PathVariable(value = "id") String id) { App app = getApp(id); app.setActive(false); dataService.update(AppMetadata.APP, app); } AppManagerController(AppManagerService appManagerService, DataService dataService); }
AppManagerController extends PluginController { @ResponseStatus(HttpStatus.OK) @PostMapping("/deactivate/{id}") public void deactivateApp(@PathVariable(value = "id") String id) { App app = getApp(id); app.setActive(false); dataService.update(AppMetadata.APP, app); } AppManagerController(AppManagerService appManagerService, DataService dataService); @GetMapping String init(); @ResponseBody @GetMapping("/apps") List<AppResponse> getApps(); @ResponseStatus(HttpStatus.OK) @PostMapping("/activate/{id}") void activateApp(@PathVariable(value = "id") String id); @ResponseStatus(HttpStatus.OK) @PostMapping("/deactivate/{id}") void deactivateApp(@PathVariable(value = "id") String id); @ResponseStatus(HttpStatus.OK) @DeleteMapping("/delete/{id}") void deleteApp(@PathVariable("id") String id); @ResponseStatus(HttpStatus.OK) @PostMapping("/upload") void uploadApp(@RequestParam("file") MultipartFile multipartFile); }
AppManagerController extends PluginController { @ResponseStatus(HttpStatus.OK) @PostMapping("/deactivate/{id}") public void deactivateApp(@PathVariable(value = "id") String id) { App app = getApp(id); app.setActive(false); dataService.update(AppMetadata.APP, app); } AppManagerController(AppManagerService appManagerService, DataService dataService); @GetMapping String init(); @ResponseBody @GetMapping("/apps") List<AppResponse> getApps(); @ResponseStatus(HttpStatus.OK) @PostMapping("/activate/{id}") void activateApp(@PathVariable(value = "id") String id); @ResponseStatus(HttpStatus.OK) @PostMapping("/deactivate/{id}") void deactivateApp(@PathVariable(value = "id") String id); @ResponseStatus(HttpStatus.OK) @DeleteMapping("/delete/{id}") void deleteApp(@PathVariable("id") String id); @ResponseStatus(HttpStatus.OK) @PostMapping("/upload") void uploadApp(@RequestParam("file") MultipartFile multipartFile); static final String ID; static final String URI; }