HouseRestController { @RequestMapping(value="query", method = {RequestMethod.GET,RequestMethod.POST}) @ResponseBody public Map<String,Object>[] getStbsByQuery(@RequestParam String q) { return service.getStbsByQuery(q.toLowerCase()); }  @RequestMapping(value="list*", method = RequestMethod.GET) @ResponseBody Map<String,Object>[] listAll(); @RequestMapping(value="id/{id}", method = {RequestMethod.GET}) @ResponseBody Map<String,Object> getStbsById(@PathVariable String id); @RequestMapping(value="edit/{id}", method = {RequestMethod.GET}) @ResponseBody Map<String,Object> editStb(@PathVariable String id); @RequestMapping(value="id/{id}", method={RequestMethod.DELETE}) @ResponseBody void deleteSingle(@PathVariable String id); @RequestMapping(value="id/{id}", method = {RequestMethod.PUT}) @ResponseBody void add(@PathVariable String id, @RequestBody Map<String,Object> data); @RequestMapping(value="id", method = {RequestMethod.POST}) @ResponseBody Map<String,Object>[] getStbsByIds(@RequestParam String[] id); @RequestMapping(value="update", method = {RequestMethod.POST}) @ResponseBody int update(@RequestParam String[] id, @RequestBody Map<String,Object> data,
            @RequestParam(defaultValue="false") boolean replace); @RequestMapping(value="remotetypes", method = {RequestMethod.GET}, produces = "application/json; charset=utf-8") @ResponseBody List<String> getRemoteTypes(); @SuppressWarnings({"unchecked", "rawtypes" }) @RequestMapping(value="update/tags/{op}", method = {RequestMethod.POST}) @ResponseBody void updateTags(@RequestBody Map<String,Object> payload, @PathVariable("op") String op); @RequestMapping(value="query", method = {RequestMethod.GET,RequestMethod.POST}) @ResponseBody Map<String,Object>[] getStbsByQuery(@RequestParam String q); @RequestMapping(value = "tag/{tag}", method = { RequestMethod.GET, RequestMethod.POST }) @ResponseBody Map<String, Object>[] getStbsByTag(@PathVariable String tag, @RequestParam(required = false) String q); @RequestMapping(value="delete", method = {RequestMethod.GET,RequestMethod.POST}) @ResponseBody void deleteStb(@RequestParam String[] id); @RequestMapping(value="populate/{token}", method=RequestMethod.POST) @ResponseBody int populate(@PathVariable String token,
            @RequestParam(required = false, defaultValue = "false", value = "isToOverride") Boolean isToOverrideMetaData); static final String[] ignoreProps; }
@Test public void testGetStbsByQuery() { String query = "a,b"; HouseRestController controller = new HouseRestController(); HouseService mockService = EasyMock.createMock(HouseService.class); EasyMock.expect(mockService.getStbsByQuery(query)).andReturn(new HashMap[1]); EasyMock.replay(mockService); ReflectionTestUtils.setField(controller, "service", mockService); Assert.assertNotNull(controller.getStbsByQuery(query)); }