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