### Question:
KycController { @RequestMapping(value = "/kyc/fetchall", method = GET, produces = APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<FetchAllResponseDTO> fetchAllKycIdentifications(@Context HttpServletRequest requestContext) { String ipAddress = IPAddressUtil.getIPAddress(requestContext); LOG.info("/fetchall called from {}", ipAddress); List<UUID> setCompleteList = new ArrayList<>(); List<UUID> errorList = new ArrayList<>(); List<Identification> identificationList = fetcher.fetchIdentifications(); for(Identification id : identificationList) { if(id.getResult() != null && id.getResult().equals("SUCCESS")) { try { UUID kycUuid = UUID.fromString(id.getId()); kycInfoService.setKycCompleteByUuid(kycUuid, true); setCompleteList.add(kycUuid); } catch(InvestorNotFoundException e) { LOG.info("No KYC data about investor with KYC-UUID {}.", id.getId()); errorList.add(UUID.fromString(id.getId())); } } else { } } return ResponseEntity .status(HttpStatus.OK) .body(new FetchAllResponseDTO().setKycCompletedList(setCompleteList).setErrorList(errorList)); }  @RequestMapping(value = "/kyc/start", method = POST, produces = APPLICATION_JSON_UTF8_VALUE) ResponseEntity<StartAllKycResponseDTO> startKyc(@Context HttpServletRequest requestContext); @RequestMapping(value = "/kyc/{investorId}/start", method = POST, consumes = APPLICATION_JSON_UTF8_VALUE, produces = APPLICATION_JSON_UTF8_VALUE) ResponseEntity<StartSingleKycResponseDTO> startKycForInvestor(@PathVariable("investorId") Long investorId,
                                                                         @RequestBody(required = false) KycStartRequestDTO kycStartRequest,
                                                                         @Context HttpServletRequest requestContext); @RequestMapping(value = "/kyc/{investorId}/remind", method = POST, produces = APPLICATION_JSON_UTF8_VALUE) ResponseEntity<RemindSingleKycResponseDTO> remindInvestor(@PathVariable("investorId") Long investorId,
                                            @Context HttpServletRequest requestContext); @RequestMapping(value = "/kyc/{investorId}/complete", method = POST, produces = APPLICATION_JSON_UTF8_VALUE) ResponseEntity<CompleteSingleKycResponseDTO> setInvestorComplete(@PathVariable("investorId") Long investorId,
                                                 @Context HttpServletRequest requestContext); @RequestMapping(value = "/kyc/{investorId}/status", method = GET, produces = APPLICATION_JSON_UTF8_VALUE) ResponseEntity<KycInfo> getKycStatus(@PathVariable("investorId") Long investorId,
                                          @Context HttpServletRequest requestContext); @RequestMapping(value = "/kyc/fetchall", method = GET, produces = APPLICATION_JSON_UTF8_VALUE) ResponseEntity<FetchAllResponseDTO> fetchAllKycIdentifications(@Context HttpServletRequest requestContext);  }### Answer:
@Test public void testFetchAllKycIdentifications() throws Exception { UUID uuid1 = UUID.randomUUID(); UUID uuid2 = UUID.randomUUID(); Identification id1 = new IdNowIdentificationProcess("SUCCESS", new Date(), uuid1.toString()); Identification id2 = new IdNowIdentificationProcess("FAILURE", new Date(), uuid2.toString()); List<Identification> idList = new ArrayList<>(); idList.add(id1); idList.add(id2); when(mockIdentificationService.fetchIdentifications()).thenReturn(idList); MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get(KYC_FETCH_ALL_IDENTIFICATIONS)) .andExpect(status().isOk()) .andDo(print()) .andReturn(); verify(mockKycInfoService, times(1)).setKycCompleteByUuid(uuid1, true); }