@Test public void shouldGetRecentFeeds() throws Exception { String category = "category1"; String vendor = "vendor1"; String baseUrl = "baseUrl"; when(vendorEventFeedService.getRecentFeed("baseUrl/path", vendor, category)).thenReturn("xml atom feed content"); String recentFeeds = controller.getRecentFeeds(category, vendor, baseUrl, request); assertThat(recentFeeds, is("xml atom feed content")); }
@RequestMapping(method = GET, value = "feeds/{category}/recent", produces = "application/atom+xml") @ResponseBody public String getRecentFeeds(@PathVariable(value = "category") String category, @RequestParam(value = "vendor", required = false) String vendor, @Value("${app.url}") String baseUrl, HttpServletRequest request) { return vendorEventFeedService.getRecentFeed(baseUrl + request.getServletPath(), vendor, category); }
AtomFeedController extends BaseController { @RequestMapping(method = GET, value = "feeds/{category}/recent", produces = "application/atom+xml") @ResponseBody public String getRecentFeeds(@PathVariable(value = "category") String category, @RequestParam(value = "vendor", required = false) String vendor, @Value("${app.url}") String baseUrl, HttpServletRequest request) { return vendorEventFeedService.getRecentFeed(baseUrl + request.getServletPath(), vendor, category); } }
AtomFeedController extends BaseController { @RequestMapping(method = GET, value = "feeds/{category}/recent", produces = "application/atom+xml") @ResponseBody public String getRecentFeeds(@PathVariable(value = "category") String category, @RequestParam(value = "vendor", required = false) String vendor, @Value("${app.url}") String baseUrl, HttpServletRequest request) { return vendorEventFeedService.getRecentFeed(baseUrl + request.getServletPath(), vendor, category); }  }
AtomFeedController extends BaseController { @RequestMapping(method = GET, value = "feeds/{category}/recent", produces = "application/atom+xml") @ResponseBody public String getRecentFeeds(@PathVariable(value = "category") String category, @RequestParam(value = "vendor", required = false) String vendor, @Value("${app.url}") String baseUrl, HttpServletRequest request) { return vendorEventFeedService.getRecentFeed(baseUrl + request.getServletPath(), vendor, category); }  @RequestMapping(method = GET, value = "feeds/{category}/recent", produces = "application/atom+xml") @ResponseBody String getRecentFeeds(@PathVariable(value = "category") String category,
                               @RequestParam(value = "vendor", required = false) String vendor,
                               @Value("${app.url}") String baseUrl,
                               HttpServletRequest request); @RequestMapping(method = GET, value = "feeds/{category}/{feedNumber}", produces = "application/atom+xml") @ResponseBody String getFeed(@PathVariable(value = "category") String category,
                        @RequestParam(value = "vendor", required = false) String vendor,
                        @PathVariable Integer feedNumber,
                        @Value("${app.url}") String baseUrl,
                        HttpServletRequest request); }
AtomFeedController extends BaseController { @RequestMapping(method = GET, value = "feeds/{category}/recent", produces = "application/atom+xml") @ResponseBody public String getRecentFeeds(@PathVariable(value = "category") String category, @RequestParam(value = "vendor", required = false) String vendor, @Value("${app.url}") String baseUrl, HttpServletRequest request) { return vendorEventFeedService.getRecentFeed(baseUrl + request.getServletPath(), vendor, category); }  @RequestMapping(method = GET, value = "feeds/{category}/recent", produces = "application/atom+xml") @ResponseBody String getRecentFeeds(@PathVariable(value = "category") String category,
                               @RequestParam(value = "vendor", required = false) String vendor,
                               @Value("${app.url}") String baseUrl,
                               HttpServletRequest request); @RequestMapping(method = GET, value = "feeds/{category}/{feedNumber}", produces = "application/atom+xml") @ResponseBody String getFeed(@PathVariable(value = "category") String category,
                        @RequestParam(value = "vendor", required = false) String vendor,
                        @PathVariable Integer feedNumber,
                        @Value("${app.url}") String baseUrl,
                        HttpServletRequest request);  }