### Question:
KycInfoService { public KycInfo getKycInfoByInvestorId(long investorId) throws InvestorNotFoundException { Optional<KycInfo> kycInfoFromDb = kycInfoRepository.findOptionalByInvestorId(investorId); return kycInfoFromDb.orElseThrow(InvestorNotFoundException::new); } @Autowired  KycInfoService(KycInfoRepository kycInfoRepository); @Transactional KycInfo saveKycInfo(long investorId, URI kycUri); @Transactional KycInfo setKycComplete(long investorId, boolean isKycComplete); @Transactional KycInfo setKycCompleteByUuid(UUID uuid, boolean isKycComplete); @Transactional KycInfo setKycUri(long investorId, String kycUri); @Transactional KycInfo setKycStartEmailSent(long investorId); @Transactional KycInfo increaseNumberOfRemindersSent(long investorId); KycInfo getKycInfoByInvestorId(long investorId); KycInfo getKycInfoByKycUuid(UUID kycUuid); List<Long> getAllInvestorIdWhereStartKycEmailSent();  }### Answer:
@Test public void testGetKycInfoByInvestorId() throws KycInfoNotSavedException { kycInfoService.saveKycInfo(2000, kycUri); try { KycInfo kycInfo = kycInfoService.getKycInfoByInvestorId(2000); assertKycInfo(kycInfo, 2000, false, 0, false, kycUri); } catch (InvestorNotFoundException e) { fail(e.getMessage()); } try { kycInfoService.getKycInfoByInvestorId(1); fail("InvestorNotFoundException should have been thrown but wasn't."); } catch(InvestorNotFoundException expectedException) { } }