### Question:
AbstractCrudController { @NonNull public ResponseEntity<S> getOne(@NonNull final ID id) { return service.getOne(id) .map(ResponseEntity::ok) .orElse(ResponseEntity.notFound().build()); } AbstractCrudController(@NonNull final CrudService<T, ID, Q, S> service); @NonNull ResponseEntity<S> create(@NonNull final Q request); @NonNull ResponseEntity<S> update(@NonNull final ID id, @NonNull final Q request); @NonNull ResponseEntity delete(@NonNull final ID id); @NonNull ResponseEntity<S> getOne(@NonNull final ID id); @NonNull ResponseEntity<Page<S>> getAll(@NonNull final Pageable pageable); @NonNull ResponseEntity<List<S>> getAll(@NonNull final Sort sort); @NonNull ResponseEntity<List<S>> getAll();  }### Answer:
@Test public void getOne() throws Exception { ResultActions result = mvc.perform(get(MODELS + "/{id}", 1) .accept(APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().contentType(APPLICATION_JSON_UTF8)); assertThat(bodyToObject(result)).isEqualTo(modelResponse1); mvc.perform(get("/tests/{id}", 0) .accept(APPLICATION_JSON)) .andExpect(status().isNotFound()) .andExpect(jsonPath("$").doesNotExist()); }