@Test public void testCreateNewMeasureForFailWithInvalidParams() throws Exception { Measure measure = createGriffinMeasure("view_item_hourly"); String measureJson = JsonUtil.toJson(measure); doThrow(new GriffinException.BadRequestException(GriffinExceptionMessage .MISSING_METRIC_NAME)) .when(service).createMeasure(measure); mvc.perform(post(URLHelper.API_VERSION_PATH + "/measures") .contentType(MediaType.APPLICATION_JSON).content(measureJson)) .andExpect(status().isBadRequest()); }
@RequestMapping(value = "/measures", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public Measure createMeasure(@RequestBody Measure measure) { return measureService.createMeasure(measure); }
MeasureController { @RequestMapping(value = "/measures", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public Measure createMeasure(@RequestBody Measure measure) { return measureService.createMeasure(measure); } }
MeasureController { @RequestMapping(value = "/measures", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public Measure createMeasure(@RequestBody Measure measure) { return measureService.createMeasure(measure); }  }
MeasureController { @RequestMapping(value = "/measures", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public Measure createMeasure(@RequestBody Measure measure) { return measureService.createMeasure(measure); }  @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", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public Measure createMeasure(@RequestBody Measure measure) { return measureService.createMeasure(measure); }  @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);  }