@Test public void createNegativeStainProtocol() throws Exception { final NegativeStainProtocol gridType = NegativeStainProtocol.builder() .label("label 3") .name("stain name") .ph(2.2f) .concentration(50f) .temperature(-100f) .incubationTime(10) .description("Lorem Ipsum") .build(); final String json = new ObjectMapper().writeValueAsString(gridType); getMockMvc().perform(post(URI).contentType(JSON_CONTENT_TYPE).content(json)).andExpect(status().isCreated()); verify(service, times(1)).createItem(gridType); }
@NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public NegativeStainProtocol createItem(@NonNull @Valid @RequestBody NegativeStainProtocol input) { return this.service.createItem(input); }
NegativeStainProtocolRestController extends BaseValidatingRestController<NegativeStainProtocol, NegativeStainProtocolService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public NegativeStainProtocol createItem(@NonNull @Valid @RequestBody NegativeStainProtocol input) { return this.service.createItem(input); } }
NegativeStainProtocolRestController extends BaseValidatingRestController<NegativeStainProtocol, NegativeStainProtocolService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public NegativeStainProtocol createItem(@NonNull @Valid @RequestBody NegativeStainProtocol input) { return this.service.createItem(input); } @Autowired  NegativeStainProtocolRestController(final NegativeStainProtocolService service,
                                        final NegativeStainProtocolValidator validator); }
NegativeStainProtocolRestController extends BaseValidatingRestController<NegativeStainProtocol, NegativeStainProtocolService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public NegativeStainProtocol createItem(@NonNull @Valid @RequestBody NegativeStainProtocol input) { return this.service.createItem(input); } @Autowired  NegativeStainProtocolRestController(final NegativeStainProtocolService service,
                                        final NegativeStainProtocolValidator validator); @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) NegativeStainProtocol createItem(@NonNull @Valid @RequestBody NegativeStainProtocol input); }
NegativeStainProtocolRestController extends BaseValidatingRestController<NegativeStainProtocol, NegativeStainProtocolService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public NegativeStainProtocol createItem(@NonNull @Valid @RequestBody NegativeStainProtocol input) { return this.service.createItem(input); } @Autowired  NegativeStainProtocolRestController(final NegativeStainProtocolService service,
                                        final NegativeStainProtocolValidator validator); @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) NegativeStainProtocol createItem(@NonNull @Valid @RequestBody NegativeStainProtocol input);  }