@Test public void testMarketplaceEntriesFeedNull() { IPerson person = new PersonImpl(); person.setUserName(USER_NAME); person.setFullName("john doe"); Mockito.when(personManager.getPerson(req)).thenReturn(person); Mockito.when( marketplaceService.browseableMarketplaceEntriesFor( person, Collections.emptySet())) .thenReturn(null); ModelAndView modelAndView = marketplaceRESTController.marketplaceEntriesFeed(req); Assert.assertNull(modelAndView.getModel().get("portlets")); }
@RequestMapping(value = "/marketplace/entries.json", method = RequestMethod.GET) public ModelAndView marketplaceEntriesFeed(HttpServletRequest request) { final IPerson user = personManager.getPerson(request); final Set<PortletCategory> empty = Collections.emptySet(); final Set<MarketplaceEntry> marketplaceEntries = marketplaceService.browseableMarketplaceEntriesFor(user, empty); return new ModelAndView("json", "portlets", marketplaceEntries); }
MarketplaceRESTController { @RequestMapping(value = "/marketplace/entries.json", method = RequestMethod.GET) public ModelAndView marketplaceEntriesFeed(HttpServletRequest request) { final IPerson user = personManager.getPerson(request); final Set<PortletCategory> empty = Collections.emptySet(); final Set<MarketplaceEntry> marketplaceEntries = marketplaceService.browseableMarketplaceEntriesFor(user, empty); return new ModelAndView("json", "portlets", marketplaceEntries); } }
MarketplaceRESTController { @RequestMapping(value = "/marketplace/entries.json", method = RequestMethod.GET) public ModelAndView marketplaceEntriesFeed(HttpServletRequest request) { final IPerson user = personManager.getPerson(request); final Set<PortletCategory> empty = Collections.emptySet(); final Set<MarketplaceEntry> marketplaceEntries = marketplaceService.browseableMarketplaceEntriesFor(user, empty); return new ModelAndView("json", "portlets", marketplaceEntries); }  }
MarketplaceRESTController { @RequestMapping(value = "/marketplace/entries.json", method = RequestMethod.GET) public ModelAndView marketplaceEntriesFeed(HttpServletRequest request) { final IPerson user = personManager.getPerson(request); final Set<PortletCategory> empty = Collections.emptySet(); final Set<MarketplaceEntry> marketplaceEntries = marketplaceService.browseableMarketplaceEntriesFor(user, empty); return new ModelAndView("json", "portlets", marketplaceEntries); }  @Autowired void setMarketplaceService(IMarketplaceService marketplaceService); @Autowired void setPersonManager(IPersonManager personManager); @Autowired void setMarketplaceRatingDAO(IMarketplaceRatingDao marketplaceRatingDAO); @RequestMapping(value = "/marketplace/entries.json", method = RequestMethod.GET) ModelAndView marketplaceEntriesFeed(HttpServletRequest request); @RequestMapping(value = "/marketplace/entry/{fname}.json") ModelAndView marketplaceEntryFeed(
            HttpServletRequest request, HttpServletResponse response, @PathVariable String fname); @RequestMapping(value = "/v5-0/marketplace/{fname}/ratings", method = RequestMethod.GET) ModelAndView getPortletRatings(HttpServletRequest request, @PathVariable String fname); @RequestMapping(value = "/marketplace/{fname}/getRating", method = RequestMethod.GET) ModelAndView getUserRating(HttpServletRequest request, @PathVariable String fname); @RequestMapping(value = "/marketplace/{fname}/rating/{rating}", method = RequestMethod.POST) ModelAndView saveUserRating(
            HttpServletRequest request,
            @PathVariable String fname,
            @PathVariable String rating,
            @RequestParam(required = false) String review); }
MarketplaceRESTController { @RequestMapping(value = "/marketplace/entries.json", method = RequestMethod.GET) public ModelAndView marketplaceEntriesFeed(HttpServletRequest request) { final IPerson user = personManager.getPerson(request); final Set<PortletCategory> empty = Collections.emptySet(); final Set<MarketplaceEntry> marketplaceEntries = marketplaceService.browseableMarketplaceEntriesFor(user, empty); return new ModelAndView("json", "portlets", marketplaceEntries); }  @Autowired void setMarketplaceService(IMarketplaceService marketplaceService); @Autowired void setPersonManager(IPersonManager personManager); @Autowired void setMarketplaceRatingDAO(IMarketplaceRatingDao marketplaceRatingDAO); @RequestMapping(value = "/marketplace/entries.json", method = RequestMethod.GET) ModelAndView marketplaceEntriesFeed(HttpServletRequest request); @RequestMapping(value = "/marketplace/entry/{fname}.json") ModelAndView marketplaceEntryFeed(
            HttpServletRequest request, HttpServletResponse response, @PathVariable String fname); @RequestMapping(value = "/v5-0/marketplace/{fname}/ratings", method = RequestMethod.GET) ModelAndView getPortletRatings(HttpServletRequest request, @PathVariable String fname); @RequestMapping(value = "/marketplace/{fname}/getRating", method = RequestMethod.GET) ModelAndView getUserRating(HttpServletRequest request, @PathVariable String fname); @RequestMapping(value = "/marketplace/{fname}/rating/{rating}", method = RequestMethod.POST) ModelAndView saveUserRating(
            HttpServletRequest request,
            @PathVariable String fname,
            @PathVariable String rating,
            @RequestParam(required = false) String review);  }