@Test(dataProvider= "Token_Provider") public void testUnReserveController(String actualToken, String expectedToken) { ServerUtils serverUtil = new ServerUtils(); DawgPoundMongoService poundService = EasyMock.createMock(DawgPoundMongoService.class); DawgPoundRestController poundController = new DawgPoundRestController(); ReflectionTestUtils.setField(poundController, "serverUtils", serverUtil); ReflectionTestUtils.setField(poundController, "service", poundService); EasyMock.expect(poundService.unreserve(TestConstants.PROCESSED_TOKEN)).andReturn(expectedToken); EasyMock.replay(poundService); actualToken = poundController.unreserve(TestConstants.TOKEN); Assert.assertEquals(actualToken, expectedToken); EasyMock.verify(poundService); }
@RequestMapping(value = "unreserve/{id}", method = RequestMethod.POST) @ResponseBody public String unreserve(@PathVariable String id) { id = clean(id); LOGGER.info("Request to unreserve device for id="+id); return service.unreserve(id); }
DawgPoundRestController { @RequestMapping(value = "unreserve/{id}", method = RequestMethod.POST) @ResponseBody public String unreserve(@PathVariable String id) { id = clean(id); LOGGER.info("Request to unreserve device for id="+id); return service.unreserve(id); } }
DawgPoundRestController { @RequestMapping(value = "unreserve/{id}", method = RequestMethod.POST) @ResponseBody public String unreserve(@PathVariable String id) { id = clean(id); LOGGER.info("Request to unreserve device for id="+id); return service.unreserve(id); }  }
DawgPoundRestController { @RequestMapping(value = "unreserve/{id}", method = RequestMethod.POST) @ResponseBody public String unreserve(@PathVariable String id) { id = clean(id); LOGGER.info("Request to unreserve device for id="+id); return service.unreserve(id); }  @RequestMapping(value = "reserved/token/{token}", method = RequestMethod.GET) @ResponseBody Map<String,Object>[] getReservered(@PathVariable String token); @RequestMapping(value = "unreserve/{id}", method = RequestMethod.POST) @ResponseBody String unreserve(@PathVariable String id); @RequestMapping(value = "reserve/{token}/{id}/{expiration}", method = RequestMethod.POST) @ResponseBody String reservePolitely(@PathVariable String token,
            @PathVariable String id, @PathVariable String expiration); @RequestMapping(value = "reserve/override/{token}/{id}/{expiration}", method = RequestMethod.POST) @ResponseBody boolean reserve(@PathVariable String token, @PathVariable String id,
            @PathVariable String expiration); @RequestMapping(value = "reserved/id/{id}", method = RequestMethod.GET) @ResponseBody Map<String, String> isReservered(@PathVariable String id); @RequestMapping(value = "list", method = RequestMethod.GET) @ResponseBody Map<String,Object>[] listAll(); }
DawgPoundRestController { @RequestMapping(value = "unreserve/{id}", method = RequestMethod.POST) @ResponseBody public String unreserve(@PathVariable String id) { id = clean(id); LOGGER.info("Request to unreserve device for id="+id); return service.unreserve(id); }  @RequestMapping(value = "reserved/token/{token}", method = RequestMethod.GET) @ResponseBody Map<String,Object>[] getReservered(@PathVariable String token); @RequestMapping(value = "unreserve/{id}", method = RequestMethod.POST) @ResponseBody String unreserve(@PathVariable String id); @RequestMapping(value = "reserve/{token}/{id}/{expiration}", method = RequestMethod.POST) @ResponseBody String reservePolitely(@PathVariable String token,
            @PathVariable String id, @PathVariable String expiration); @RequestMapping(value = "reserve/override/{token}/{id}/{expiration}", method = RequestMethod.POST) @ResponseBody boolean reserve(@PathVariable String token, @PathVariable String id,
            @PathVariable String expiration); @RequestMapping(value = "reserved/id/{id}", method = RequestMethod.GET) @ResponseBody Map<String, String> isReservered(@PathVariable String id); @RequestMapping(value = "list", method = RequestMethod.GET) @ResponseBody Map<String,Object>[] listAll();  }