Ejemplo n.º 1
0
 @Logged
 @RequestMapping(
     value = "",
     method = RequestMethod.POST,
     consumes = MediaType.APPLICATION_JSON_VALUE)
 HttpEntity create(@RequestBody TestCaseDTO dto) {
   return new ResponseEntity<>(testCaseService.create(dto), HttpStatus.CREATED);
 }
Ejemplo n.º 2
0
 @Logged
 @RequestMapping(
     value = "/{id}",
     method = RequestMethod.PUT,
     consumes = MediaType.APPLICATION_JSON_VALUE)
 HttpEntity update(@PathVariable long id, @RequestBody TestCaseDTO dto) {
   if (dto.getId() != id) {
     return new ResponseEntity<>("ID in URL does not match ID in body", HttpStatus.CONFLICT);
   }
   return new ResponseEntity<>(testCaseService.update(dto), HttpStatus.OK);
 }
Ejemplo n.º 3
0
 @Logged
 @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
 HttpEntity delete(@PathVariable long id) {
   testCaseService.delete(id);
   return new ResponseEntity<>(HttpStatus.ACCEPTED);
 }
Ejemplo n.º 4
0
 @Logged
 @RequestMapping(value = "", method = RequestMethod.GET)
 HttpEntity readAll(@PageableDefault Pageable pageable) {
   Page<TestCaseDTO> dtos = testCaseService.readAll(pageable);
   return new ResponseEntity<>(dtos, HttpStatus.OK);
 }
Ejemplo n.º 5
0
 @Logged
 @RequestMapping(value = "/{id}", method = RequestMethod.GET)
 HttpEntity read(@PathVariable long id) {
   return new ResponseEntity<>(testCaseService.read(id), HttpStatus.OK);
 }