@Test public void testGetAllMeasuresByOwner() throws Exception { String owner = "test"; List<Measure> measureList = new LinkedList<>(); Measure measure = createGriffinMeasure("view_item_hourly"); measureList.add(measure); given(service.getAliveMeasuresByOwner(owner)).willReturn(measureList); mvc.perform(get(URLHelper.API_VERSION_PATH + "/measures/owner/" + owner) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.[0].name", is("view_item_hourly"))) ; }
@RequestMapping(value = "/measures/owner/{owner}", method = RequestMethod.GET) public List<Measure> getAliveMeasuresByOwner(@PathVariable("owner") @Valid String owner) { return measureService.getAliveMeasuresByOwner(owner); }
MeasureController { @RequestMapping(value = "/measures/owner/{owner}", method = RequestMethod.GET) public List<Measure> getAliveMeasuresByOwner(@PathVariable("owner") @Valid String owner) { return measureService.getAliveMeasuresByOwner(owner); } }
MeasureController { @RequestMapping(value = "/measures/owner/{owner}", method = RequestMethod.GET) public List<Measure> getAliveMeasuresByOwner(@PathVariable("owner") @Valid String owner) { return measureService.getAliveMeasuresByOwner(owner); }  }
MeasureController { @RequestMapping(value = "/measures/owner/{owner}", method = RequestMethod.GET) public List<Measure> getAliveMeasuresByOwner(@PathVariable("owner") @Valid String owner) { return measureService.getAliveMeasuresByOwner(owner); }  @RequestMapping(value = "/measures", method = RequestMethod.GET) List<? extends Measure> getAllAliveMeasures(@RequestParam(value =
        "type", defaultValue = "") String type); @RequestMapping(value = "/measures/{id}", method = RequestMethod.GET) Measure getMeasureById(@PathVariable("id") long id); @RequestMapping(value = "/measures/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) void deleteMeasureById(@PathVariable("id") Long id); @RequestMapping(value = "/measures", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) void deleteMeasures(); @RequestMapping(value = "/measures", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) Measure updateMeasure(@RequestBody Measure measure); @RequestMapping(value = "/measures/owner/{owner}", method = RequestMethod.GET) List<Measure> getAliveMeasuresByOwner(@PathVariable("owner")
                                                 @Valid String owner); @RequestMapping(value = "/measures", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) Measure createMeasure(@RequestBody Measure measure); }
MeasureController { @RequestMapping(value = "/measures/owner/{owner}", method = RequestMethod.GET) public List<Measure> getAliveMeasuresByOwner(@PathVariable("owner") @Valid String owner) { return measureService.getAliveMeasuresByOwner(owner); }  @RequestMapping(value = "/measures", method = RequestMethod.GET) List<? extends Measure> getAllAliveMeasures(@RequestParam(value =
        "type", defaultValue = "") String type); @RequestMapping(value = "/measures/{id}", method = RequestMethod.GET) Measure getMeasureById(@PathVariable("id") long id); @RequestMapping(value = "/measures/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) void deleteMeasureById(@PathVariable("id") Long id); @RequestMapping(value = "/measures", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) void deleteMeasures(); @RequestMapping(value = "/measures", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) Measure updateMeasure(@RequestBody Measure measure); @RequestMapping(value = "/measures/owner/{owner}", method = RequestMethod.GET) List<Measure> getAliveMeasuresByOwner(@PathVariable("owner")
                                                 @Valid String owner); @RequestMapping(value = "/measures", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) Measure createMeasure(@RequestBody Measure measure);  }