@Test public void createSurfaceTreatmentMachine() throws Exception { final SurfaceTreatmentMachine machine = SurfaceTreatmentMachine.builder().label("label 3").build(); final String json = new ObjectMapper().writeValueAsString(machine); getMockMvc().perform(post(URI).contentType(JSON_CONTENT_TYPE).content(json)).andExpect(status().isCreated()); verify(service, times(1)).createItem(machine); }
@NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public SurfaceTreatmentMachine createItem(@NonNull @Valid @RequestBody SurfaceTreatmentMachine input) { return this.service.createItem(input); }
SurfaceTreatmentMachineRestController extends BaseValidatingRestController<SurfaceTreatmentMachine,
        SurfaceTreatmentMachineService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public SurfaceTreatmentMachine createItem(@NonNull @Valid @RequestBody SurfaceTreatmentMachine input) { return this.service.createItem(input); } }
SurfaceTreatmentMachineRestController extends BaseValidatingRestController<SurfaceTreatmentMachine,
        SurfaceTreatmentMachineService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public SurfaceTreatmentMachine createItem(@NonNull @Valid @RequestBody SurfaceTreatmentMachine input) { return this.service.createItem(input); } @Autowired  SurfaceTreatmentMachineRestController(final SurfaceTreatmentMachineService service,
                                          final SurfaceTreatmentMachineValidator validator); }
SurfaceTreatmentMachineRestController extends BaseValidatingRestController<SurfaceTreatmentMachine,
        SurfaceTreatmentMachineService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public SurfaceTreatmentMachine createItem(@NonNull @Valid @RequestBody SurfaceTreatmentMachine input) { return this.service.createItem(input); } @Autowired  SurfaceTreatmentMachineRestController(final SurfaceTreatmentMachineService service,
                                          final SurfaceTreatmentMachineValidator validator); @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) SurfaceTreatmentMachine createItem(@NonNull @Valid @RequestBody SurfaceTreatmentMachine input); }
SurfaceTreatmentMachineRestController extends BaseValidatingRestController<SurfaceTreatmentMachine,
        SurfaceTreatmentMachineService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public SurfaceTreatmentMachine createItem(@NonNull @Valid @RequestBody SurfaceTreatmentMachine input) { return this.service.createItem(input); } @Autowired  SurfaceTreatmentMachineRestController(final SurfaceTreatmentMachineService service,
                                          final SurfaceTreatmentMachineValidator validator); @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) SurfaceTreatmentMachine createItem(@NonNull @Valid @RequestBody SurfaceTreatmentMachine input);  }