diff --git a/src/main/java/no/fintlabs/externalUser/ExternalUser.java b/src/main/java/no/fintlabs/externalUser/ExternalUser.java index 84addbb..c8362de 100644 --- a/src/main/java/no/fintlabs/externalUser/ExternalUser.java +++ b/src/main/java/no/fintlabs/externalUser/ExternalUser.java @@ -23,26 +23,29 @@ public class ExternalUser { private String lastName; private String userType; private String userName; - private UUID identityProviderUserObjectId; + private UUID idpUserObjectId; private String mainOrganisationUnitName; private String mainOrganisationUnitId; private String mobilePhone; private String email; + private String userPrincipalName; + public boolean isValid(){ return this.getUserType().equals("EXTERNAL"); } public User toUser(){ + return User .builder() .id(id) .firstName(firstName) .lastName(lastName) - .userType(userType) - .resourceId(String.valueOf(identityProviderUserObjectId)) + .userType("EXTERNAL") + .resourceId(String.valueOf(idpUserObjectId)) .userName(userName) - .identityProviderUserObjectId(identityProviderUserObjectId) + .identityProviderUserObjectId(idpUserObjectId) .mainOrganisationUnitName(mainOrganisationUnitName) .mainOrganisationUnitId(mainOrganisationUnitId) .email(email) @@ -51,6 +54,9 @@ public User toUser(){ } + + + public SimpelExternalUser toSimpleExternalUser() { return SimpelExternalUser .builder() diff --git a/src/main/java/no/fintlabs/externalUser/ExternalUserConsumerConfiguration.java b/src/main/java/no/fintlabs/externalUser/ExternalUserConsumerConfiguration.java index 3b1f4e7..b0992b1 100644 --- a/src/main/java/no/fintlabs/externalUser/ExternalUserConsumerConfiguration.java +++ b/src/main/java/no/fintlabs/externalUser/ExternalUserConsumerConfiguration.java @@ -17,7 +17,7 @@ public ConcurrentMessageListenerContainer externalUserCons ){ EntityTopicNameParameters entityTopicNameParameters = EntityTopicNameParameters .builder() - .resource("externaluser") + .resource("azureuserexternal") .build(); return entityConsumerFactoryService.createFactory( diff --git a/src/test/java/no/fintlabs/externalUser/ExternalUserServiceTest.java b/src/test/java/no/fintlabs/externalUser/ExternalUserServiceTest.java index 22c2a5c..721a0b9 100644 --- a/src/test/java/no/fintlabs/externalUser/ExternalUserServiceTest.java +++ b/src/test/java/no/fintlabs/externalUser/ExternalUserServiceTest.java @@ -15,7 +15,7 @@ public void shouldReturnUser() { ExternalUser externalUser = ExternalUser .builder() .userName("titten@tei.no") - .identityProviderUserObjectId(UUID.fromString("f37f3048-637a-11ee-8c99-0242ac120002")) + .idpUserObjectId(UUID.fromString("f37f3048-637a-11ee-8c99-0242ac120002")) .userType("EXTERNAL") .build();