### Question:
CmsAspspTppServiceInternal implements CmsAspspTppService { @Transactional @Override public boolean unblockTpp(@NotNull String tppAuthorisationNumber, @NotNull String instanceId) { Optional<TppStopListEntity> stopListEntityOptional = stopListRepository.findByTppAuthorisationNumberAndInstanceId(tppAuthorisationNumber, instanceId); if (stopListEntityOptional.isPresent()) { TppStopListEntity entityToBeUnblocked = stopListEntityOptional.get(); entityToBeUnblocked.unblock(); } return true; }  @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 unblockTpp_Success_TppEntityIsNotExistInDB() { when(stopListRepository.findByTppAuthorisationNumberAndInstanceId(AUTHORISATION_NUMBER_NOT_EXISTING, INSTANCE_ID)) .thenReturn(Optional.empty()); boolean isUnblocked = cmsAspspTppService.unblockTpp(AUTHORISATION_NUMBER_NOT_EXISTING, INSTANCE_ID); assertTrue(isUnblocked); verify(stopListRepository, never()).save(any(TppStopListEntity.class)); }
@Test void unblockTpp_Success_TppEntityIsExistInDB() { when(stopListRepository.findByTppAuthorisationNumberAndInstanceId(AUTHORISATION_NUMBER, INSTANCE_ID)) .thenReturn(Optional.of(tppStopListEntity)); doNothing() .when(tppStopListEntity).unblock(); boolean isUnblocked = cmsAspspTppService.unblockTpp(AUTHORISATION_NUMBER, INSTANCE_ID); assertTrue(isUnblocked); }