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 0bfe79d5e3a..8c9730072ee 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 @@ -440,4 +440,6 @@ mosip.security.authentication.provider.beans.list.pre-registration-application-s mosip.security.authentication.provider.beans.list.pre-registration-booking-service=customJWTAuthProvider mosip.kernel.data-key-splitter: #KEY_SPLITTER# -pre.reg.login.otp.validation-attempt-threshold: 10 \ No newline at end of file +pre.reg.login.otp.validation-attempt-threshold: 10 + +mosip.preregistration.user.admin: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 49e13944279..a76aeb7a060 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 @@ -30,6 +30,9 @@ public class AnonymousProfileService implements AnonymousProfileServiceIntf { @Value("${mosip.utc-datetime-pattern}") private String utcDateTimePattern; + + @Value("${mosip.preregistration.user.admin}") + private String userName; /** * Autowired reference for {@link #AnonymousProfileRepostiory} @@ -67,9 +70,9 @@ public AnonymousProfileResponseDTO saveAnonymousProfile(AnonymousProfileRequestD AnonymousProfileEntity requestEntity = new AnonymousProfileEntity(); requestEntity.setId(UUIDGeneratorUtil.generateId()); requestEntity.setProfile(requestDto.getProfileDetails()); - requestEntity.setCreatedBy(authUserDetails().getUserId()); + requestEntity.setCreatedBy(userName); requestEntity.setCreateDateTime(currentDateTime); - requestEntity.setUpdatedBy(authUserDetails().getUserId()); + requestEntity.setUpdatedBy(userName); 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 5ac060de5fe..a772670ad72 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 @@ -41,6 +41,9 @@ public class AnonymousProfileServiceTest { @Value("${mosip.utc-datetime-pattern}") private String utcDateTimePattern; + + @Value("${mosip.preregistration.user.admin}") + private String userName; AnonymousProfileResponseDTO responseDto = new AnonymousProfileResponseDTO(); @@ -70,9 +73,9 @@ public void saveAnonymousProfileTest() { requestEntity.setId(id); requestEntity.setProfile(requestDto.getProfileDetails()); - requestEntity.setCreatedBy(anonymousProfileService.authUserDetails().getUserId()); + requestEntity.setCreatedBy(userName); requestEntity.setCreateDateTime(currentDateTime); - requestEntity.setUpdatedBy(anonymousProfileService.authUserDetails().getUserId()); + requestEntity.setUpdatedBy(userName); requestEntity.setUpdateDateTime(currentDateTime); requestEntity.setIsDeleted(false); requestDto.setProfileDetails(profile); @@ -95,9 +98,9 @@ public void saveAnonymousProfileExceptionTest() throws Exception { requestEntity.setId(id); requestEntity.setProfile(requestDto.getProfileDetails()); - requestEntity.setCreatedBy(anonymousProfileService.authUserDetails().getUserId()); + requestEntity.setCreatedBy(userName); requestEntity.setCreateDateTime(currentDateTime); - requestEntity.setUpdatedBy(anonymousProfileService.authUserDetails().getUserId()); + requestEntity.setUpdatedBy(userName); 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 cc59d72a026..77e1ad9546e 100644 --- a/pre-registration/pre-registration-core/src/test/resources/application.properties +++ b/pre-registration/pre-registration-core/src/test/resources/application.properties @@ -82,3 +82,5 @@ spring.cloud.config.uri=${dev.dns.url}/config spring.cloud.config.label=develop spring.cloud.config.name=pre-registration spring.profiles.active=mz + +mosip.preregistration.user.admin:admin