generated from FINTLabs/fint-spring-boot-template-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test for converting externaluser to user
- Loading branch information
Erling Jahr
committed
Oct 5, 2023
1 parent
7d1f60d
commit d164530
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/test/java/no/fintlabs/externalUser/ExternalUserServiceTest.java
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package no.fintlabs.externalUser; | ||
|
||
import no.fintlabs.user.User; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.UUID; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class ExternalUserServiceTest { | ||
private ExternalUserService externalUserService; | ||
|
||
@Test | ||
public void shouldReturnUser() { | ||
ExternalUser externalUser = ExternalUser | ||
.builder() | ||
.userName("titten@tei.no") | ||
.identityProviderUserObjectId(UUID.fromString("f37f3048-637a-11ee-8c99-0242ac120002")) | ||
.userType("EXTERNAL") | ||
.build(); | ||
|
||
User userToBeConverted = User | ||
.builder() | ||
.userName("titten@tei.no") | ||
.identityProviderUserObjectId(UUID.fromString("f37f3048-637a-11ee-8c99-0242ac120002")) | ||
.userType("EXTERNAL") | ||
.resourceId("f37f3048-637a-11ee-8c99-0242ac120002") | ||
.build(); | ||
|
||
User convertedUser = externalUser.toUser(); | ||
|
||
assertEquals(userToBeConverted.getResourceId(),convertedUser.getResourceId()); | ||
} | ||
|
||
|
||
} |