### Question:
CmsAspspTppServiceInternal implements CmsAspspTppService { @NotNull @Override public Optional<TppStopListRecord> getTppStopListRecord(@NotNull String tppAuthorisationNumber, @NotNull String instanceId) { Optional<TppStopListEntity> stopListEntityOptional = stopListRepository.findByTppAuthorisationNumberAndInstanceId(tppAuthorisationNumber, instanceId); return stopListEntityOptional.map(tppStopListMapper::mapToTppStopListRecord); }  @NotNull @Override Optional<TppStopListRecord> getTppStopListRecord(@NotNull String tppAuthorisationNumber, @NotNull String instanceId); @Transactional @Override boolean blockTpp(@NotNull String tppAuthorisationNumber, @NotNull String instanceId, @Nullable Duration lockPeriod); @Transactional @Override boolean unblockTpp(@NotNull String tppAuthorisationNumber, @NotNull String instanceId); @NotNull @Override Optional<TppInfo> getTppInfo(@NotNull String tppAuthorisationNumber, @NotNull String instanceId);  }### Answer:
@Test void getTppStopListRecord_Fail_TppEntityIsNotExistInDB() { when(stopListRepository.findByTppAuthorisationNumberAndInstanceId(AUTHORISATION_NUMBER_NOT_EXISTING, INSTANCE_ID)) .thenReturn(Optional.empty()); Optional<TppStopListRecord> result = cmsAspspTppService.getTppStopListRecord(AUTHORISATION_NUMBER_NOT_EXISTING, INSTANCE_ID); assertFalse(result.isPresent()); }
@Test void getTppStopListRecord_Success_TppEntityIsExistInDB() { when(stopListRepository.findByTppAuthorisationNumberAndInstanceId(AUTHORISATION_NUMBER, INSTANCE_ID)) .thenReturn(Optional.of(tppStopListEntity)); when(tppStopListMapper.mapToTppStopListRecord(tppStopListEntity)) .thenReturn(tppStopListRecord); Optional<TppStopListRecord> result = cmsAspspTppService.getTppStopListRecord(AUTHORISATION_NUMBER, INSTANCE_ID); assertTrue(result.isPresent()); assertEquals(tppStopListRecord, result.get()); }