PortfolioController { @GetMapping("/{name}/{lob}/products") public List<BuildingBlockMetricSummary> getPortfolioProducts(@PathVariable("name") String name, @PathVariable("lob") String lob) { return portfolioService.getPortfolioProducts(name, lob); } @Autowired  PortfolioController(PortfolioService portfolioService); @GetMapping() List<PortfolioResponse> getPortfolios(); @GetMapping("/{name}/{lob}") PortfolioResponse getPortfolio(@PathVariable("name") String name, @PathVariable("lob") String lob); @GetMapping("/{name}/{lob}/products") List<BuildingBlockMetricSummary> getPortfolioProducts(@PathVariable("name") String name,
                                                                         @PathVariable("lob") String lob); @GetMapping("/{name}/{lob}/products/{productName}") BuildingBlockMetricSummary getPortfolioProduct(
            @PathVariable("name") String name,
            @PathVariable("lob") String lob,
            @PathVariable("productName") String productName); @GetMapping("/{name}/{lob}/products/{productName}/components") List<BuildingBlockMetricSummary> getProductComponents(
            @PathVariable("name") String name,
            @PathVariable("lob") String lob,
            @PathVariable("productName") String productName);  }
@Test public void getPortfolioProducts() throws Exception { when(portfolioService.getPortfolioProducts("test", "lob")).thenReturn(Stream.of(TestUtils.makeBuildingBlockMetricSummary()).collect(Collectors.toList())); mockMvc.perform(MockMvcRequestBuilders.get("/portfolio/test/lob/products")) .andExpect(status().isOk()); verify(portfolioService).getPortfolioProducts("test", "lob"); }