@Test public void getPortfolioMetricDetail() throws Exception { when(metricsService.getPortfolioMetricDetail(MetricType.SCM_COMMITS,"portfolio1", "lob")).thenReturn(TestUtils.makeProductMetricDetail()); mockMvc.perform(MockMvcRequestBuilders.get("/metrics/SCM/portfolio/portfolio1/lob/detail")) .andDo(print()) .andExpect(status().isOk()); verify(metricsService).getPortfolioMetricDetail(null,"portfolio1", "lob"); }
@GetMapping("/{metric}/portfolio/{name}/{lob}/detail") public MetricDetails getPortfolioMetricDetail( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob) { return metricsService.getPortfolioMetricDetail(metricType, name, lob); }
MetricsController { @GetMapping("/{metric}/portfolio/{name}/{lob}/detail") public MetricDetails getPortfolioMetricDetail( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob) { return metricsService.getPortfolioMetricDetail(metricType, name, lob); } }
MetricsController { @GetMapping("/{metric}/portfolio/{name}/{lob}/detail") public MetricDetails getPortfolioMetricDetail( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob) { return metricsService.getPortfolioMetricDetail(metricType, name, lob); } MetricsController(MetricsService metricsService,
                             BuildingBlocksService buildingBlocksService,
                             MetricsDetailService metricsDetailService); }
MetricsController { @GetMapping("/{metric}/portfolio/{name}/{lob}/detail") public MetricDetails getPortfolioMetricDetail( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob) { return metricsService.getPortfolioMetricDetail(metricType, name, lob); } 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}/portfolio/{name}/{lob}/detail") public MetricDetails getPortfolioMetricDetail( @PathVariable("metric") MetricType metricType, @PathVariable("name") String name, @PathVariable("lob") String lob) { return metricsService.getPortfolioMetricDetail(metricType, name, lob); } 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);  }