Skip to content

Commit

Permalink
[MOSIP-29805] Updated Anonymous profile
Browse files Browse the repository at this point in the history
Signed-off-by: Aiham <[email protected]>
  • Loading branch information
aihamh committed Dec 18, 2023
1 parent c9025cc commit 384bc46
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,4 +424,6 @@ auth.server.admin.allowed.audience=mosip-regproc-client,mosip-prereg-client,mosi
#the custom auth provider component names list
#mosip.security.authentication.provider.beans.list=customJWTAuthProvider
mosip.security.authentication.provider.beans.list.pre-registration-application-service=customJWTAuthProvider
mosip.security.authentication.provider.beans.list.pre-registration-booking-service=customJWTAuthProvider
mosip.security.authentication.provider.beans.list.pre-registration-booking-service=customJWTAuthProvider

mosip.preregistration.user.admin:admin
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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}
*/
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class AnonymousProfileServiceTest {
@Value("${mosip.utc-datetime-pattern}")
private String utcDateTimePattern;

@Value("${mosip.preregistration.user.admin}")
private String userName;

AnonymousProfileResponseDTO responseDto = new AnonymousProfileResponseDTO();

LocalDateTime currentDateTime = LocalDateTime.now(ZoneId.of("UTC"));
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 384bc46

Please sign in to comment.