-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#931: UserBusinessService test for delete user by id
- Loading branch information
1 parent
687b5d1
commit c36b2db
Showing
3 changed files
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,11 +38,19 @@ class UserBusinessServiceTest { | |
|
||
@BeforeEach | ||
void setUp() { | ||
User userAlice = User.Builder.builder().withId(2L).withFirstname("Alice").withLastname("Wunderland") | ||
.withEmail("[email protected]").build(); | ||
|
||
User userBob = User.Builder.builder().withId(9L).withFirstname("Bob").withLastname("Baumeister") | ||
.withEmail("[email protected]").build(); | ||
User userAlice = User.Builder.builder() // | ||
.withId(2L) // | ||
.withFirstname("Alice") // | ||
.withLastname("Wunderland") // | ||
.withEmail("[email protected]") // | ||
.build(); | ||
|
||
User userBob = User.Builder.builder() // | ||
.withId(9L) // | ||
.withFirstname("Bob") // | ||
.withLastname("Baumeister") // | ||
.withEmail("[email protected]") // | ||
.build(); | ||
|
||
userList = Arrays.asList(userAlice, userBob); | ||
} | ||
|
@@ -162,4 +170,11 @@ void setOkrChampion_shouldNotThrowExceptionIfSecondLastOkrChampIsRemoved() { | |
verify(userPersistenceService, times(1)).save(user); | ||
assertFalse(user.isOkrChampion()); | ||
} | ||
|
||
@Test | ||
void shouldDeleteUser() { | ||
userBusinessService.deleteEntityById(23L); | ||
|
||
verify(userPersistenceService, times(1)).deleteById(23L); | ||
} | ||
} |