@Test public void testGetAllMetricsSuccess() throws Exception { Metric metric = new Metric("metricName", ACCURACY, "owner", Collections .emptyList()); given(service.getAllMetrics()).willReturn( Collections.singletonMap("measureName", Collections .singletonList(metric))); mvc.perform(get(URLHelper.API_VERSION_PATH + "/metrics")) .andExpect(status().isOk()) .andExpect(jsonPath("$.measureName", hasSize(1))); }
@RequestMapping(value = "/metrics", method = RequestMethod.GET) public Map<String, List<Metric>> getAllMetrics() { return metricService.getAllMetrics(); }
MetricController { @RequestMapping(value = "/metrics", method = RequestMethod.GET) public Map<String, List<Metric>> getAllMetrics() { return metricService.getAllMetrics(); } }
MetricController { @RequestMapping(value = "/metrics", method = RequestMethod.GET) public Map<String, List<Metric>> getAllMetrics() { return metricService.getAllMetrics(); }  }
MetricController { @RequestMapping(value = "/metrics", method = RequestMethod.GET) public Map<String, List<Metric>> getAllMetrics() { return metricService.getAllMetrics(); }  @RequestMapping(value = "/metrics", method = RequestMethod.GET) Map<String, List<Metric>> getAllMetrics(); @RequestMapping(value = "/metrics/values", method = RequestMethod.GET) List<MetricValue> getMetricValues(@RequestParam("metricName")
                                                 String metricName,
                                             @RequestParam("size") int size,
                                             @RequestParam(value = "offset",
                                                 defaultValue = "0")
                                                 int offset,
                                             @RequestParam(value = "tmst",
                                                 defaultValue = "0")
                                                 long tmst); @RequestMapping(value = "/metrics/values", method = RequestMethod.POST) ResponseEntity<?> addMetricValues(@RequestBody List<MetricValue>
                                                 values); @RequestMapping(value = "/metrics/values", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) ResponseEntity<?> deleteMetricValues(@RequestParam("metricName")
                                                    String metricName); @RequestMapping(value = "/metrics/values/{instanceId}", method = RequestMethod.GET) MetricValue getMetric(@PathVariable("instanceId") Long id); }
MetricController { @RequestMapping(value = "/metrics", method = RequestMethod.GET) public Map<String, List<Metric>> getAllMetrics() { return metricService.getAllMetrics(); }  @RequestMapping(value = "/metrics", method = RequestMethod.GET) Map<String, List<Metric>> getAllMetrics(); @RequestMapping(value = "/metrics/values", method = RequestMethod.GET) List<MetricValue> getMetricValues(@RequestParam("metricName")
                                                 String metricName,
                                             @RequestParam("size") int size,
                                             @RequestParam(value = "offset",
                                                 defaultValue = "0")
                                                 int offset,
                                             @RequestParam(value = "tmst",
                                                 defaultValue = "0")
                                                 long tmst); @RequestMapping(value = "/metrics/values", method = RequestMethod.POST) ResponseEntity<?> addMetricValues(@RequestBody List<MetricValue>
                                                 values); @RequestMapping(value = "/metrics/values", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) ResponseEntity<?> deleteMetricValues(@RequestParam("metricName")
                                                    String metricName); @RequestMapping(value = "/metrics/values/{instanceId}", method = RequestMethod.GET) MetricValue getMetric(@PathVariable("instanceId") Long id);  }