From 387b57bd95dfb750970f2f416b7d534bfbaa8b75 Mon Sep 17 00:00:00 2001 From: Aiham Date: Tue, 19 Dec 2023 16:28:05 +0530 Subject: [PATCH] [MOSIP-29805] Updated Anonymous profile naming convention Signed-off-by: Aiham --- .../src/main/resources/application.properties | 2 +- .../anonymous/service/AnonymousProfileService.java | 8 ++++---- .../service/test/AnonymousProfileServiceTest.java | 12 ++++++------ .../src/test/resources/application.properties | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pre-registration/pre-registration-application-service/src/main/resources/application.properties b/pre-registration/pre-registration-application-service/src/main/resources/application.properties index 8c9730072e..4197b7155a 100644 --- a/pre-registration/pre-registration-application-service/src/main/resources/application.properties +++ b/pre-registration/pre-registration-application-service/src/main/resources/application.properties @@ -442,4 +442,4 @@ mosip.security.authentication.provider.beans.list.pre-registration-booking-servi mosip.kernel.data-key-splitter: #KEY_SPLITTER# pre.reg.login.otp.validation-attempt-threshold: 10 -mosip.preregistration.user.admin:admin \ No newline at end of file +mosip.preregistration.anonymous-profile-username:admin \ No newline at end of file diff --git a/pre-registration/pre-registration-core/src/main/java/io/mosip/analytics/event/anonymous/service/AnonymousProfileService.java b/pre-registration/pre-registration-core/src/main/java/io/mosip/analytics/event/anonymous/service/AnonymousProfileService.java index a76aeb7a06..9f4d9a0f1d 100644 --- a/pre-registration/pre-registration-core/src/main/java/io/mosip/analytics/event/anonymous/service/AnonymousProfileService.java +++ b/pre-registration/pre-registration-core/src/main/java/io/mosip/analytics/event/anonymous/service/AnonymousProfileService.java @@ -31,8 +31,8 @@ public class AnonymousProfileService implements AnonymousProfileServiceIntf { @Value("${mosip.utc-datetime-pattern}") private String utcDateTimePattern; - @Value("${mosip.preregistration.user.admin}") - private String userName; + @Value("${mosip.preregistration.anonymous-profile-username}") + private String anonymousProfileUsername; /** * Autowired reference for {@link #AnonymousProfileRepostiory} @@ -70,9 +70,9 @@ public AnonymousProfileResponseDTO saveAnonymousProfile(AnonymousProfileRequestD AnonymousProfileEntity requestEntity = new AnonymousProfileEntity(); requestEntity.setId(UUIDGeneratorUtil.generateId()); requestEntity.setProfile(requestDto.getProfileDetails()); - requestEntity.setCreatedBy(userName); + requestEntity.setCreatedBy(anonymousProfileUsername); requestEntity.setCreateDateTime(currentDateTime); - requestEntity.setUpdatedBy(userName); + requestEntity.setUpdatedBy(anonymousProfileUsername); requestEntity.setUpdateDateTime(currentDateTime); requestEntity.setIsDeleted(false); diff --git a/pre-registration/pre-registration-core/src/test/java/io/mosip/analytics/event/anonymous/service/test/AnonymousProfileServiceTest.java b/pre-registration/pre-registration-core/src/test/java/io/mosip/analytics/event/anonymous/service/test/AnonymousProfileServiceTest.java index a772670ad7..fff53afb60 100644 --- a/pre-registration/pre-registration-core/src/test/java/io/mosip/analytics/event/anonymous/service/test/AnonymousProfileServiceTest.java +++ b/pre-registration/pre-registration-core/src/test/java/io/mosip/analytics/event/anonymous/service/test/AnonymousProfileServiceTest.java @@ -42,8 +42,8 @@ public class AnonymousProfileServiceTest { @Value("${mosip.utc-datetime-pattern}") private String utcDateTimePattern; - @Value("${mosip.preregistration.user.admin}") - private String userName; + @Value("${mosip.preregistration.anonymous-profile-username}") + private String anonymousProfileUsername; AnonymousProfileResponseDTO responseDto = new AnonymousProfileResponseDTO(); @@ -73,9 +73,9 @@ public void saveAnonymousProfileTest() { requestEntity.setId(id); requestEntity.setProfile(requestDto.getProfileDetails()); - requestEntity.setCreatedBy(userName); + requestEntity.setCreatedBy(anonymousProfileUsername); requestEntity.setCreateDateTime(currentDateTime); - requestEntity.setUpdatedBy(userName); + requestEntity.setUpdatedBy(anonymousProfileUsername); requestEntity.setUpdateDateTime(currentDateTime); requestEntity.setIsDeleted(false); requestDto.setProfileDetails(profile); @@ -98,9 +98,9 @@ public void saveAnonymousProfileExceptionTest() throws Exception { requestEntity.setId(id); requestEntity.setProfile(requestDto.getProfileDetails()); - requestEntity.setCreatedBy(userName); + requestEntity.setCreatedBy(anonymousProfileUsername); requestEntity.setCreateDateTime(currentDateTime); - requestEntity.setUpdatedBy(userName); + requestEntity.setUpdatedBy(anonymousProfileUsername); requestEntity.setUpdateDateTime(currentDateTime); requestEntity.setIsDeleted(false); requestDto.setProfileDetails(profile); diff --git a/pre-registration/pre-registration-core/src/test/resources/application.properties b/pre-registration/pre-registration-core/src/test/resources/application.properties index 77e1ad9546..749d06e43f 100644 --- a/pre-registration/pre-registration-core/src/test/resources/application.properties +++ b/pre-registration/pre-registration-core/src/test/resources/application.properties @@ -83,4 +83,4 @@ spring.cloud.config.label=develop spring.cloud.config.name=pre-registration spring.profiles.active=mz -mosip.preregistration.user.admin:admin +mosip.preregistration.anonymous-profile-username:admin