diff --git a/src/test/java/no/fintlabs/externalUser/ExternalUserServiceTest.java b/src/test/java/no/fintlabs/externalUser/ExternalUserServiceTest.java new file mode 100644 index 0000000..22c2a5c --- /dev/null +++ b/src/test/java/no/fintlabs/externalUser/ExternalUserServiceTest.java @@ -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()); + } + + +} \ No newline at end of file