Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
pierpaolo.didato@emeal.nttdata.com authored and pierpaolo.didato@emeal.nttdata.com committed Dec 11, 2024
1 parent 759a6e4 commit 0717e43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void saveTokenWithAttachment(OnboardingAttachment onboardingAttachment) {

private boolean checkTokenExist(Onboarding onboarding) {
// Skip if token already exists
Optional<Token> optToken = tokenRepository.findByOnboardingId(onboarding.getId());
Optional<Token> optToken = tokenRepository.findByIdOptional(onboarding.getId());
if (optToken.isPresent()) {
log.debug("Token has already exists for onboarding {}", onboarding.getId());
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ void saveToken_shouldSkipIfTokenExists() {
Token token = createDummyToken();
onboardingWorkflow.setOnboarding(onboarding);

when(tokenRepository.findByOnboardingId(onboarding.getId())).thenReturn(Optional.of(token));
when(tokenRepository.findByIdOptional(onboarding.getId())).thenReturn(Optional.of(token));

onboardingService.saveTokenWithContract(onboardingWorkflow);

Mockito.verify(tokenRepository, Mockito.times(1)).findByOnboardingId(onboarding.getId());
Mockito.verify(tokenRepository, Mockito.times(1)).findByIdOptional(onboarding.getId());
Mockito.verifyNoMoreInteractions(tokenRepository);
}

Expand Down

0 comments on commit 0717e43

Please sign in to comment.