### Question:
AspspSearchController implements AspspSearchApi { @Override public ResponseEntity<AspspTO> getById(String id) { Optional<Aspsp> aspsp = aspspSearchService.findById(id); return aspsp.map(value -> ResponseEntity.ok(aspspMapper.toAspspTO(value))) .orElseGet(() -> ResponseEntity.notFound().build()); } AspspSearchController(AspspReadOnlyRepository aspspSearchService); @Override ResponseEntity<List<AspspTO>> getAspsps(@RequestParam(required = false) String name,
                                                   @RequestParam(required = false) String bic,
                                                   @RequestParam(required = false) String bankCode,
                                                   @RequestParam(required = false) String iban, // if present - other params ignored
                                                   @RequestParam(required = false) String after,
                                                   @RequestParam(required = false, defaultValue = "10") int size); @Override ResponseEntity<AspspTO> getById(String id);  }### Answer:
@Test void getById() throws Exception { Aspsp aspsp = buildAspsp(); AspspTO aspspTO = mapper.toAspspTO(aspsp); String aspspTOJson = new ObjectMapper().writeValueAsString(aspspTO); when(repository.findById(ASPSP_ID)).thenReturn(Optional.of(aspsp)); MvcResult mvcResult = mockMvc.perform(get(AspspSearchApi.V1_APSPS_BY_ID, ASPSP_ID).content(aspspTOJson)) .andExpect(status().is(HttpStatus.OK.value())) .andReturn(); AspspTO response = JsonReader.getInstance() .getObjectFromString(mvcResult.getResponse().getContentAsString(), AspspTO.class); assertThat(response).isEqualTo(aspspTO); }