@Test void testGetApps() throws Exception { when(appManagerService.getApps()).thenReturn(newArrayList(appResponse)); mockMvc .perform(get(AppManagerController.URI + "/apps")) .andExpect(status().is(200)) .andExpect( content() .string( "[{\"id\":\"id\",\"name\":\"app1\",\"label\":\"label\",\"description\":\"description\",\"isActive\":true,\"includeMenuAndFooter\":true,\"templateContent\":\"\\u003ch1\\u003eTest\\u003c/h1\\u003e\",\"version\":\"v1.0.0\",\"resourceFolder\":\"resource-folder\",\"appConfig\":\"{\\u0027config\\u0027: \\u0027test\\u0027}\"}]")); }
@ResponseBody @GetMapping("/apps") public List<AppResponse> getApps() { return appManagerService.getApps(); }
AppManagerController extends PluginController { @ResponseBody @GetMapping("/apps") public List<AppResponse> getApps() { return appManagerService.getApps(); } }
AppManagerController extends PluginController { @ResponseBody @GetMapping("/apps") public List<AppResponse> getApps() { return appManagerService.getApps(); } AppManagerController(AppManagerService appManagerService, DataService dataService); }
AppManagerController extends PluginController { @ResponseBody @GetMapping("/apps") public List<AppResponse> getApps() { return appManagerService.getApps(); } 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 { @ResponseBody @GetMapping("/apps") public List<AppResponse> getApps() { return appManagerService.getApps(); } 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; }