### Question:
PluginManagerController extends BaseController implements ApplicationContextAware { @RequestMapping(method = RequestMethod.GET, value="/agent/summary", headers="Accept=application/json") public @ResponseBody List<String> getAgentStatusSummary() { List<String> agentNames = new ArrayList<String>(); Map<Integer, AgentPluginStatus> failureAgents = pluginManager.getStatusesByAgentId(AgentPluginStatusEnum.SYNC_FAILURE); for (Map.Entry<Integer, AgentPluginStatus> failedAgent : failureAgents.entrySet()){ AgentPluginStatus status = failedAgent.getValue(); agentNames.add(getAgentName(status.getAgent())); } Collections.sort(agentNames); return agentNames; } @Autowired  PluginManagerController(AppdefBoss appdefBoss, AuthzBoss authzBoss, 
            PluginManager pluginManager, AgentManager agentManager, ResourceManager resourceManager,
            ServerConfigManager serverConfigManager); @RequestMapping(method = RequestMethod.GET) String index(Model model); @RequestMapping(method = RequestMethod.GET, value="/resource/count", headers="Accept=application/json") @ResponseBody List<Map<String, String>> getResourceCount(@RequestParam("deleteIds") String deleteIds); @RequestMapping(method = RequestMethod.GET, value="/list", headers="Accept=application/json") @ResponseBody List<Map<String, Object>> getPluginSummaries(); @RequestMapping(method = RequestMethod.GET, value="/info", headers="Accept=application/json") @ResponseBody Map<String, Object> getAgentInfo(); @RequestMapping(method = RequestMethod.GET, value="/agent/summary", headers="Accept=application/json") @ResponseBody List<String> getAgentStatusSummary(); @RequestMapping(method = RequestMethod.GET, value="/agent/old/summary", headers="Accept=application/json") @ResponseBody List<Map<String,String>> getOldAgentStatusSummary(); @RequestMapping(method = RequestMethod.GET, value="/agent/unsynchable/cur/summary", headers="Accept=application/json") @ResponseBody List<Map<String,String>> getCurrentNonSyncAgentStatusSummary(); @RequestMapping(method = RequestMethod.GET, value="/status/{pluginId}", headers="Accept=application/json") @ResponseBody List<Map<String, Object>> getAgentStatus(@PathVariable int pluginId, 
        @RequestParam("searchWord") String searchWord, @RequestParam("status") String status); @RequestMapping(method = RequestMethod.DELETE, value="/delete") @ResponseBody String deletePlugin(@RequestParam(RequestParameterKeys.DELETE_ID) 
                                              String[] deleteIds, HttpSession session); @RequestMapping(method = RequestMethod.POST, value="/upload") String uploadProductPlugin(@RequestParam MultipartFile[] plugins, HttpSession session, Model model); void setApplicationContext(ApplicationContext applicationContext);  }### Answer:
@Test public void testAgentSummary(){ expect(mockPluginManager.getStatusesByAgentId(AgentPluginStatusEnum.SYNC_FAILURE)).andStubReturn(getStatusesByAgentId()); replay(mockPluginManager); List<String> summaries = pluginManagerController.getAgentStatusSummary(); assertEquals("There should be only two agents in summary",2,summaries.size()); assertEquals("agentX's name should be 3.3.3.3","3.3.3.3",summaries.get(0)); assertEquals("agentZ's name should be 5.5.5.5","5.5.5.5",summaries.get(1)); }