Skip to content

Commit

Permalink
added test for converting externaluser to user
Browse files Browse the repository at this point in the history
  • Loading branch information
Erling Jahr committed Oct 5, 2023
1 parent 7d1f60d commit d164530
Showing 1 changed file with 36 additions and 0 deletions.
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());
}


}

0 comments on commit d164530

Please sign in to comment.