### Question:
ProjectRestController extends BaseValidatingRestController<Project, ProjectService> { @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) public Project createItem(@NonNull @Valid @RequestBody Project input) { return this.service.createItem(input); } @Autowired  ProjectRestController(ProjectService service, ProjectValidator validator); @NonNull @PostMapping @ResponseStatus(HttpStatus.CREATED) Project createItem(@NonNull @Valid @RequestBody Project input); @NonNull @GetMapping(value = "/{projectSlugOrId}/protein") List<Protein> getProteins(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/protein/count") Integer countProteins(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/ligand") List<Ligand> getLigands(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/ligand/count") Integer countLigands(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/sample") List<Sample> getSamples(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/sampleWithProjectLabels") List<Sample> getSamplesWithProjectLabels(
            @NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/sample/count") Integer countSamples(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/grid") List<Grid> getGrids(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/grid/count") Integer countGrids(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/microscopy-session") List<MicroscopySession> getMicroscopySessions(
            @NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/microscopy-session/count") Integer countMicroscopySessions(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/processing-session") List<ProcessingSession> getProcessingSessions(
            @NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/processing-session/count") Integer countProcessingSessions(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/map") List<Map> getMaps(
            @NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/map/count") Integer countMaps(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/model") List<Model> getModels(
            @NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId); @NonNull @GetMapping(value = "/{projectSlugOrId}/model/count") Integer countModels(@NonNull @PathVariable("projectSlugOrId") final String projectSlugOrId);  }### Answer:
@Test public void createProjects() throws Exception { final Project project = Project.builder().label("label 3").build(); final String json = new ObjectMapper().writeValueAsString(project); getMockMvc().perform(post(URI).contentType(JSON_CONTENT_TYPE).content(json)).andExpect(status().isCreated()); verify(service, times(1)).createItem(project); }