### Question:
SearchController extends BaseController { @RequestMapping(method = RequestMethod.GET, value = "/search") public @ResponseBody Map<String, List<Map<String, String>>> listSearchResults( @RequestParam(RequestParameterKeys.SEARCH_STRING) String searchString, HttpSession session) { final int DEFAULT_PAGE_SIZE = 10; Map<String, List<Map<String, String>>> result = new LinkedHashMap<String, List<Map<String, String>>>(); PageControl page = new PageControl(0, DEFAULT_PAGE_SIZE); WebUser webUser = getWebUser(session); try { PageList<SearchResult> resources = getAppdefBoss().search( webUser.getSessionId(), searchString, page); result.put("resources", constructResourceMaps(resources)); } catch (PermissionException e) { log.debug("User doesn't have the permission to perform this operation", e); } catch (SessionNotFoundException e) { log.debug("User's session can't be found", e); } catch (SessionTimeoutException e) { log.debug("User's session has timed out", e); } catch (Exception e) { log.debug(e); } try { PageList<AuthzSubject> users = getAuthzBoss().getSubjectsByName( webUser.getSessionId(), searchString, page); result.put("users", constructUserMaps(users)); } catch (PermissionException e) { log.debug("User doesn't have the permission to perform this operation", e); } catch (SessionNotFoundException e) { log.debug("User's session can't be found", e); } catch (SessionTimeoutException e) { log.debug("User's session has timed out", e); } catch (Exception e) { log.debug(e); } return result; } @Autowired  SearchController(AppdefBoss appdefBoss, AuthzBoss authzBoss); @RequestMapping(method = RequestMethod.GET, value = "/search") @ResponseBody Map<String, List<Map<String, String>>> listSearchResults(
			@RequestParam(RequestParameterKeys.SEARCH_STRING) String searchString,
			HttpSession session);  }### Answer:
@Test public void testListSearchResults() throws SessionNotFoundException, SessionTimeoutException, PermissionException { final String SEARCH_STRING = "tes"; expect( mockAuthzBoss.getSubjectsByName(eq(SESSION_ID), eq(SEARCH_STRING), isA(PageControl.class))).andReturn( constructMockAuthzSubjectsReturnValue(SEARCH_STRING)); expect( mockAppdefBoss.search(eq(SESSION_ID.intValue()), eq(SEARCH_STRING), isA(PageControl.class))).andReturn( constructMockSearchResultsReturnValue(SEARCH_STRING)); replay(mockAppdefBoss, mockAuthzBoss); Map<String, List<Map<String, String>>> result = controller .listSearchResults(SEARCH_STRING, mockSession); verify(mockAppdefBoss, mockAuthzBoss); assertTrue("Result should contain a key called 'resources'", result .containsKey("resources")); assertEquals("There should be 10 resources in the result", 10, result .get("resources").size()); assertTrue("Result should contain a key called 'users'", result .containsKey("users")); assertEquals("There should be 5 users in the result", 5, result.get( "users").size()); }