@Test public void createImageProcessingSoftware() throws Exception { final ImageProcessingSoftware imageProcessingSoftware = ImageProcessingSoftware.builder() .label("label 3") .softwareVersions(Collections.singletonList("7.0")) .build(); final String json = new ObjectMapper().writeValueAsString(imageProcessingSoftware); getMockMvc().perform(post(URI).contentType(JSON_CONTENT_TYPE).content(json)).andExpect(status().isCreated()); verify(service, times(1)).createItem(imageProcessingSoftware); }
@NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public ImageProcessingSoftware createItem(@NonNull @Valid @RequestBody ImageProcessingSoftware input) { return this.service.createItem(input); }
ImageProcessingSoftwareRestController extends BaseValidatingRestController<ImageProcessingSoftware,
        ImageProcessingSoftwareService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public ImageProcessingSoftware createItem(@NonNull @Valid @RequestBody ImageProcessingSoftware input) { return this.service.createItem(input); } }
ImageProcessingSoftwareRestController extends BaseValidatingRestController<ImageProcessingSoftware,
        ImageProcessingSoftwareService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public ImageProcessingSoftware createItem(@NonNull @Valid @RequestBody ImageProcessingSoftware input) { return this.service.createItem(input); } @Autowired  ImageProcessingSoftwareRestController(final ImageProcessingSoftwareService service,
                                          final ImageProcessingSoftwareValidator validator); }
ImageProcessingSoftwareRestController extends BaseValidatingRestController<ImageProcessingSoftware,
        ImageProcessingSoftwareService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public ImageProcessingSoftware createItem(@NonNull @Valid @RequestBody ImageProcessingSoftware input) { return this.service.createItem(input); } @Autowired  ImageProcessingSoftwareRestController(final ImageProcessingSoftwareService service,
                                          final ImageProcessingSoftwareValidator validator); @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) ImageProcessingSoftware createItem(@NonNull @Valid @RequestBody ImageProcessingSoftware input); }
ImageProcessingSoftwareRestController extends BaseValidatingRestController<ImageProcessingSoftware,
        ImageProcessingSoftwareService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public ImageProcessingSoftware createItem(@NonNull @Valid @RequestBody ImageProcessingSoftware input) { return this.service.createItem(input); } @Autowired  ImageProcessingSoftwareRestController(final ImageProcessingSoftwareService service,
                                          final ImageProcessingSoftwareValidator validator); @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) ImageProcessingSoftware createItem(@NonNull @Valid @RequestBody ImageProcessingSoftware input);  }