@Test public void getProductMetricComponents() throws Exception { when(metricsService.getProductMetricComponents(MetricType.SCM_COMMITS,"portfolio1", "lob","product1")).thenReturn(Stream.of(TestUtils.makeBuildingBlockMetricSummary()).collect(Collectors.toList())); mockMvc.perform(MockMvcRequestBuilders.get("/metrics/SCM/product/portfolio1/lob/product1/component")) .andDo(print()) .andExpect(status().isOk()); verify(metricsService).getProductMetricComponents(null,"portfolio1", "lob","product1"); }
@GetMapping("/{metric}/product/{name}/{lob}/{productName}/component") public List<BuildingBlockMetricSummary> getProductMetricComponents( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob, @PathVariable("productName") String productName) { return metricsService.getProductMetricComponents(metricType, name, lob, productName); }
MetricsController { @GetMapping("/{metric}/product/{name}/{lob}/{productName}/component") public List<BuildingBlockMetricSummary> getProductMetricComponents( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob, @PathVariable("productName") String productName) { return metricsService.getProductMetricComponents(metricType, name, lob, productName); } }
MetricsController { @GetMapping("/{metric}/product/{name}/{lob}/{productName}/component") public List<BuildingBlockMetricSummary> getProductMetricComponents( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob, @PathVariable("productName") String productName) { return metricsService.getProductMetricComponents(metricType, name, lob, productName); } MetricsController(MetricsService metricsService,
                             BuildingBlocksService buildingBlocksService,
                             MetricsDetailService metricsDetailService); }
MetricsController { @GetMapping("/{metric}/product/{name}/{lob}/{productName}/component") public List<BuildingBlockMetricSummary> getProductMetricComponents( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob, @PathVariable("productName") String productName) { return metricsService.getProductMetricComponents(metricType, name, lob, productName); } MetricsController(MetricsService metricsService,
                             BuildingBlocksService buildingBlocksService,
                             MetricsDetailService metricsDetailService); @GetMapping("/{metric}/lob/{name}/{lob}/summary") MetricDetails getLobMetricSummary(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/lob/{name}/{lob}/detail") MetricDetails getLobMetricDetail(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/lob/{name}/{lob}/product") List<BuildingBlockMetricSummary> getLobMetricProducts(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/portfolio/{name}/{lob}/summary") MetricDetails getPortfolioMetricSummary(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/portfolio/{name}/{lob}/detail") MetricDetails getPortfolioMetricDetail(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/portfolio/{name}/{lob}/product") List<BuildingBlockMetricSummary> getPortfolioMetricProducts(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/product/{name}/{lob}/{productName}/summary") MetricDetails getProductMetricSummary(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob,
            @PathVariable("productName") String productName); @GetMapping("/{metric}/product/{name}/{lob}/{productName}/detail") MetricDetails getProductMetricDetail(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob,
            @PathVariable("productName") String productName); @GetMapping("/{metric}/product/{name}/{lob}/{productName}/component") List<BuildingBlockMetricSummary> getProductMetricComponents(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob,
            @PathVariable("productName") String productName); @GetMapping("/{metric}/portfolio/{id}/summary") MetricSummary getPortfolioMetricSummary(@PathVariable("metric") MetricType metricType,
                                                   @PathVariable("id") String portfolioId); @GetMapping("/{metric}/portfolio/{id}/detail") MetricsDetail getPortfolioMetricDetail(@PathVariable("metric") MetricType metricType,
                                                  @PathVariable("id") String portfolioId); @GetMapping("/{metric}/portfolio/{id}/product") List<BuildingBlocks> getPortfolioMetricProducts(@PathVariable("metric") MetricType metricType,
                                                           @PathVariable("id") String portfolioId); @GetMapping("/{metric}/product/{id}/summary") MetricSummary getProductMetricSummary(@PathVariable("metric") MetricType metricType,
                                                 @PathVariable("id") String productId); @GetMapping("/{metric}/product/{id}/detail") MetricsDetail getProductMetricDetail(@PathVariable("metric") MetricType metricType,
                                                @PathVariable("id") String productId); @GetMapping("/{metric}/product/{id}/component") List<BuildingBlocks> getProductMetricComponents(@PathVariable("metric") MetricType metricType,
                                                           @PathVariable("id") String productId); @InitBinder void initBinder(final WebDataBinder webdataBinder); }
MetricsController { @GetMapping("/{metric}/product/{name}/{lob}/{productName}/component") public List<BuildingBlockMetricSummary> getProductMetricComponents( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob, @PathVariable("productName") String productName) { return metricsService.getProductMetricComponents(metricType, name, lob, productName); } MetricsController(MetricsService metricsService,
                             BuildingBlocksService buildingBlocksService,
                             MetricsDetailService metricsDetailService); @GetMapping("/{metric}/lob/{name}/{lob}/summary") MetricDetails getLobMetricSummary(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/lob/{name}/{lob}/detail") MetricDetails getLobMetricDetail(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/lob/{name}/{lob}/product") List<BuildingBlockMetricSummary> getLobMetricProducts(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/portfolio/{name}/{lob}/summary") MetricDetails getPortfolioMetricSummary(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/portfolio/{name}/{lob}/detail") MetricDetails getPortfolioMetricDetail(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/portfolio/{name}/{lob}/product") List<BuildingBlockMetricSummary> getPortfolioMetricProducts(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob); @GetMapping("/{metric}/product/{name}/{lob}/{productName}/summary") MetricDetails getProductMetricSummary(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob,
            @PathVariable("productName") String productName); @GetMapping("/{metric}/product/{name}/{lob}/{productName}/detail") MetricDetails getProductMetricDetail(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob,
            @PathVariable("productName") String productName); @GetMapping("/{metric}/product/{name}/{lob}/{productName}/component") List<BuildingBlockMetricSummary> getProductMetricComponents(
            @PathVariable("metric") MetricType metricType,
            @PathVariable("name") String name,
            @PathVariable("lob") String lob,
            @PathVariable("productName") String productName); @GetMapping("/{metric}/portfolio/{id}/summary") MetricSummary getPortfolioMetricSummary(@PathVariable("metric") MetricType metricType,
                                                   @PathVariable("id") String portfolioId); @GetMapping("/{metric}/portfolio/{id}/detail") MetricsDetail getPortfolioMetricDetail(@PathVariable("metric") MetricType metricType,
                                                  @PathVariable("id") String portfolioId); @GetMapping("/{metric}/portfolio/{id}/product") List<BuildingBlocks> getPortfolioMetricProducts(@PathVariable("metric") MetricType metricType,
                                                           @PathVariable("id") String portfolioId); @GetMapping("/{metric}/product/{id}/summary") MetricSummary getProductMetricSummary(@PathVariable("metric") MetricType metricType,
                                                 @PathVariable("id") String productId); @GetMapping("/{metric}/product/{id}/detail") MetricsDetail getProductMetricDetail(@PathVariable("metric") MetricType metricType,
                                                @PathVariable("id") String productId); @GetMapping("/{metric}/product/{id}/component") List<BuildingBlocks> getProductMetricComponents(@PathVariable("metric") MetricType metricType,
                                                           @PathVariable("id") String productId); @InitBinder void initBinder(final WebDataBinder webdataBinder);  }