AppFrameworkController { @RequestMapping(value = "/module/appframework/apps.json", method = RequestMethod.GET) @ResponseBody public List<AppDescriptor> getApps() { log.info("Fetching the list of apps"); AppFrameworkService appFrameworkService = getAppFrameworkService(); List<AppDescriptor> appsList = appFrameworkService.getAllApps(); if (log.isDebugEnabled()) log.debug("Fetched all apps : " + appsList); return appsList; }  @RequestMapping(value = "/module/appframework/apps.json", method = RequestMethod.GET) @ResponseBody List<AppDescriptor> getApps(); @RequestMapping(value = "/module/appframework/extensions.json", method = RequestMethod.GET) @ResponseBody List<Extension> getExtensions(@RequestParam String extensionPointId); @RequestMapping(value = "/module/appframework/enabled_apps.json", method = RequestMethod.GET) @ResponseBody List<AppDescriptor> getEnabledApps(); @RequestMapping(value = "/module/appframework/enabled_extensions.json", method = RequestMethod.GET) @ResponseBody List<Extension> getEnabledExtensions(@RequestParam String extensionPointId); @RequestMapping(value = "/module/appframework/enable_apps.json", method = RequestMethod.GET) @ResponseBody void enableApp(@RequestParam String appId); @RequestMapping(value = "/module/appframework/disable_apps.json", method = RequestMethod.GET) @ResponseBody void disableApp(@RequestParam String appId); @RequestMapping(value = "/module/appframework/enable_extensions.json", method = RequestMethod.GET) @ResponseBody void enableExtension(@RequestParam String extensionId); @RequestMapping(value = "/module/appframework/disable_extensions.json", method = RequestMethod.GET) @ResponseBody void disableExtension(@RequestParam String extensionId);  }
@Test public void testGetAllApps() throws Exception { mockStatic(Context.class); when(Context.getService(AppFrameworkService.class)).thenReturn(mockAppFrameworkService); when(mockAppFrameworkService.getAllApps()).thenReturn(getTestAppList()); List<AppDescriptor> appList = new AppFrameworkController().getApps(); assertNotNull(appList); assertEquals(3, appList.size()); assertEquals("app1", appList.get(0).getId()); }