Skip to content

Commit

Permalink
🚧 #70 updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
rucko24 committed Nov 22, 2024
1 parent bacfa0f commit 616ff86
Showing 1 changed file with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,6 @@ void updateEntityWizardReadFlash(WizardEspDto wizardReadFlashViewDto, WizardEspD
verifyNoMoreInteractions(repository);
}

@ParameterizedTest
@ArgumentsSource(WizardUpdateEspServiceProvider.class)
@DisplayName("")
void updateTwoEntities(WizardEspDto wizardReadFlashViewDto, WizardEspDto updatedDto,
WizardEspEntity updatedEntity) {

WizardEspEntity toSave = WizardEspMapper.INSTANCE.dtoToEntity(updatedDto);
WizardEspEntity findById = WizardEspMapper.INSTANCE.dtoToEntity(wizardReadFlashViewDto);

when(repository.findById(findById.getId())).thenReturn(Optional.of(updatedEntity));
when(repository.save(toSave)).thenReturn(updatedEntity);

assertThatCode(() -> wizardEspService.save(updatedDto)).doesNotThrowAnyException();

verify(repository, times(1)).findById(findById.getId());
verify(repository, times(1)).save(toSave);
verifyNoMoreInteractions(repository);

}

@ParameterizedTest
@ArgumentsSource(WizardEspServiceProvider.class)
@DisplayName("id is empty, the new entity is saved")
Expand Down

0 comments on commit 616ff86

Please sign in to comment.