diff --git a/registration-processor/mosip-stage-executor/pom.xml b/registration-processor/mosip-stage-executor/pom.xml index c09a699b8f7..e326e496541 100644 --- a/registration-processor/mosip-stage-executor/pom.xml +++ b/registration-processor/mosip-stage-executor/pom.xml @@ -26,6 +26,16 @@ registration-processor-core ${registration.processor.core.version} + + io.mosip.registrationprocessor + registration-processor-credential-requestor-stage + 1.2.0.1-B3 + + + io.mosip.kernel + kernel-auth-adapter + 1.2.0.1-B2 + diff --git a/registration-processor/mosip-stage-executor/src/main/resources/bootstrap.properties b/registration-processor/mosip-stage-executor/src/main/resources/bootstrap.properties index 84c3600122c..b429c85eb1f 100644 --- a/registration-processor/mosip-stage-executor/src/main/resources/bootstrap.properties +++ b/registration-processor/mosip-stage-executor/src/main/resources/bootstrap.properties @@ -1,7 +1,7 @@ -spring.cloud.config.uri=localhost +spring.cloud.config.uri=http://localhost:51000/config spring.cloud.config.label=master spring.application.name=application,registration-processor -spring.profiles.active=dev +spring.profiles.active=default spring.cloud.config.name=registration-processor config.server.file.storage.uri=${spring.cloud.config.uri}/${packet.info.storage.service}/${spring.profiles.active}/${spring.cloud.config.label}/ management.endpoints.web.exposure.include=refresh diff --git a/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java b/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java index 39ee23c62ca..d2dd1aa6cae 100644 --- a/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java +++ b/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java @@ -162,6 +162,12 @@ public void deployVerticle() { mosipEventBus = this.getEventBus(this, clusterManagerUrl, workerPoolSize); this.consumeAndSend(mosipEventBus, MessageBusAddress.PRINTING_BUS_IN, MessageBusAddress.PRINTING_BUS_OUT, messageExpiryTimeLimit); + + MessageDTO messageDTO = new MessageDTO(); + messageDTO.setRid("11631114541001520240104070442"); + messageDTO.setReg_type("NEW"); + messageDTO.setWorkflowInstanceId("f0b9911b-0c47-4454-8c8b-98d49109de38"); + process(messageDTO); } /* @@ -196,7 +202,7 @@ public MessageDTO process(MessageDTO object) { registrationStatusDto .setLatestTransactionTypeCode(RegistrationTransactionTypeCode.PRINT_SERVICE.toString()); registrationStatusDto.setRegistrationStageName(getStageName()); - JSONObject jsonObject = utilities.retrieveUIN(regId); + JSONObject jsonObject = utilities.idrepoRetrieveIdentityByRid(regId); uin = JsonUtil.getJSONValue(jsonObject, IdType.UIN.toString()); if (uin == null) { regProcLogger.error(LoggerFileConstant.SESSIONID.toString(), diff --git a/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/util/CredentialPartnerUtil.java b/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/util/CredentialPartnerUtil.java index b357a6076e0..4495ae6e7ed 100644 --- a/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/util/CredentialPartnerUtil.java +++ b/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/util/CredentialPartnerUtil.java @@ -5,10 +5,7 @@ import io.mosip.kernel.core.exception.ExceptionUtils; import io.mosip.kernel.core.logger.spi.Logger; import io.mosip.kernel.core.util.exception.JsonProcessingException; -import io.mosip.registration.processor.core.constant.JsonConstant; -import io.mosip.registration.processor.core.constant.LoggerFileConstant; -import io.mosip.registration.processor.core.constant.MappingJsonConstants; -import io.mosip.registration.processor.core.constant.ProviderStageName; +import io.mosip.registration.processor.core.constant.*; import io.mosip.registration.processor.core.exception.ApisResourceAccessException; import io.mosip.registration.processor.core.exception.PacketManagerException; import io.mosip.registration.processor.core.exception.RegistrationProcessorCheckedException; @@ -128,11 +125,11 @@ public List getCredentialPartners(String regId, String regist return Lists.emptyList(); } - Map identityFieldValueMap = utilities.getPacketManagerService().getFields(regId, - requiredIdObjectFieldNames, registrationType, ProviderStageName.CREDENTIAL_REQUESTOR); + Map identityFieldValueMap = new HashMap<>(); + requiredIdObjectFieldNames.forEach(field -> identityFieldValueMap.put(field, JsonUtil.getJSONValue(identity, field))); Map context = new HashMap<>(); - for (Map.Entry identityAttribute: identityFieldValueMap.entrySet()) { + for (Map.Entry identityAttribute: identityFieldValueMap.entrySet()) { JSONObject attributeObject = new JSONObject(identityFieldValueMap); try { if (identityAttribute.getKey() != null && identityAttribute.getValue() != null) { diff --git a/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/test/java/io/mosip/registrationprocessor/credentialrequestor/test/CredentialRequestorStageTest.java b/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/test/java/io/mosip/registrationprocessor/credentialrequestor/test/CredentialRequestorStageTest.java index 1177e4e19c7..b635ab725a1 100644 --- a/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/test/java/io/mosip/registrationprocessor/credentialrequestor/test/CredentialRequestorStageTest.java +++ b/registration-processor/post-processor/registration-processor-credential-requestor-stage/src/test/java/io/mosip/registrationprocessor/credentialrequestor/test/CredentialRequestorStageTest.java @@ -245,7 +245,7 @@ public void setup() throws Exception { Map map1 = new HashMap<>(); map1.put("UIN", "4238135072"); JSONObject jsonObject = new JSONObject(map1); - Mockito.when(utitilites.retrieveUIN(any())).thenReturn(jsonObject); + Mockito.when(utitilites.idrepoRetrieveIdentityByRid(any())).thenReturn(jsonObject); CredentialPartner partner1 = new CredentialPartner(); partner1.setId("digitalcardPartner"); @@ -394,7 +394,7 @@ public void testUINNotavailable() Map map1 = new HashMap<>(); JSONObject jsonObject = new JSONObject(map1); - Mockito.when(utitilites.retrieveUIN(any())).thenReturn(jsonObject); + Mockito.when(utitilites.idrepoRetrieveIdentityByRid(any())).thenReturn(jsonObject); MessageDTO result = stage.process(dto); assertFalse(result.getIsValid()); diff --git a/registration-processor/registration-processor-info-storage-service/src/main/java/io/mosip/registration/processor/packet/storage/utils/Utilities.java b/registration-processor/registration-processor-info-storage-service/src/main/java/io/mosip/registration/processor/packet/storage/utils/Utilities.java index 99b7abac080..b4418f83811 100644 --- a/registration-processor/registration-processor-info-storage-service/src/main/java/io/mosip/registration/processor/packet/storage/utils/Utilities.java +++ b/registration-processor/registration-processor-info-storage-service/src/main/java/io/mosip/registration/processor/packet/storage/utils/Utilities.java @@ -662,7 +662,7 @@ public String getLatestTransactionId(String registrationId, String process, int * @throws IOException Signals that an I/O exception has * occurred. */ - public JSONObject retrieveUIN(String regId) throws ApisResourceAccessException, IdRepoAppException, IOException { + public JSONObject idrepoRetrieveIdentityByRid(String regId) throws ApisResourceAccessException, IdRepoAppException, IOException { regProcLogger.debug(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(), regId, "Utilities::retrieveUIN()::entry"); diff --git a/registration-processor/registration-processor-message-sender-impl/src/main/java/io/mosip/registration/processor/message/sender/service/impl/MessageNotificationServiceImpl.java b/registration-processor/registration-processor-message-sender-impl/src/main/java/io/mosip/registration/processor/message/sender/service/impl/MessageNotificationServiceImpl.java index cd551b37bd3..36413df5774 100644 --- a/registration-processor/registration-processor-message-sender-impl/src/main/java/io/mosip/registration/processor/message/sender/service/impl/MessageNotificationServiceImpl.java +++ b/registration-processor/registration-processor-message-sender-impl/src/main/java/io/mosip/registration/processor/message/sender/service/impl/MessageNotificationServiceImpl.java @@ -449,7 +449,7 @@ private Map setAttributes(String id, String process, String lang String uin = ""; if (idType.toString().equalsIgnoreCase(UIN)) { - JSONObject jsonObject = utility.retrieveUIN(id); + JSONObject jsonObject = utility.idrepoRetrieveIdentityByRid(id); uin = JsonUtil.getJSONValue(jsonObject, UIN); attributes.put("RID", id); attributes.put("UIN", uin); diff --git a/registration-processor/registration-processor-message-sender-impl/src/test/java/io/mosip/registration/processor/message/sender/test/service/MessageNotificationServiceImplTest.java b/registration-processor/registration-processor-message-sender-impl/src/test/java/io/mosip/registration/processor/message/sender/test/service/MessageNotificationServiceImplTest.java index 4f242aa7e98..ea6d1b11d1e 100644 --- a/registration-processor/registration-processor-message-sender-impl/src/test/java/io/mosip/registration/processor/message/sender/test/service/MessageNotificationServiceImplTest.java +++ b/registration-processor/registration-processor-message-sender-impl/src/test/java/io/mosip/registration/processor/message/sender/test/service/MessageNotificationServiceImplTest.java @@ -202,7 +202,7 @@ public void setup() throws Exception { map1.put("UIN", "423072"); JSONObject jsonObject1 = new JSONObject(map1); - Mockito.when(utility.retrieveUIN(any())).thenReturn(jsonObject1); + Mockito.when(utility.idrepoRetrieveIdentityByRid(any())).thenReturn(jsonObject1); Mockito.when(utility.getGetRegProcessorDemographicIdentity()).thenReturn("identity"); InputStream in = IOUtils.toInputStream("Hi Alok, Your UIN is generated", "UTF-8");