From 3228b3b9952ac6503a42ba76af60d5dbd09db014 Mon Sep 17 00:00:00 2001 From: Sowmya Ujjappa Banakar Date: Wed, 17 Jul 2024 13:11:21 +0530 Subject: [PATCH 1/3] MOSIP-34112 code changes Signed-off-by: Sowmya Ujjappa Banakar --- .../constants/BioDedupeConstants.java | 94 ++++++++++--------- .../biodedupe/stage/BioDedupeProcessor.java | 36 ++++++- .../stage/BioDedupeProcessorTest.java | 44 ++++++++- .../core/status/util/StatusUtil.java | 3 + 4 files changed, 130 insertions(+), 47 deletions(-) diff --git a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/constants/BioDedupeConstants.java b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/constants/BioDedupeConstants.java index b73b4fc62c9..6d1c65c5eee 100644 --- a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/constants/BioDedupeConstants.java +++ b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/constants/BioDedupeConstants.java @@ -1,45 +1,49 @@ -package io.mosip.registration.processor.biodedupe.constants; - -public class BioDedupeConstants { - - /** The Constant FILE_SEPARATOR. */ - public static final String FILE_SEPARATOR = "\\"; - - /** The Constant INDIVIDUAL_BIOMETRICS. */ - public static final String INDIVIDUAL_BIOMETRICS = "individualBiometrics"; - - public static final String VALUE = "value"; - - public static final String CBEFF_PRESENT_IN_PACKET = "Cbeff is present in the packet, destination stage is abis_handler"; - - public static final String CBEFF_NOT_PRESENT_IN_PACKET = "Cbeff is not present in the packet. This will be sent to manual verification."; - - public static final String CBEFF_ABSENT_IN_PACKET = "Cbeff is absent in the packet for child, destination stage is UIN"; - - public static final String UPDATE_PACKET_BIOMETRIC_NOT_NULL = "Update packet individual biometric not null, destination stage is abis_handler"; - - public static final String UPDATE_PACKET_BIOMETRIC_NULL = "Update packet individual biometric null, destination stage is UIN"; - - public static final String ABIS_RESPONSE_NOT_NULL = "ABIS response Details not null, destination stage is Manual_verification"; - - public static final String ABIS_RESPONSE_NULL = "ABIS response Details null, destination stage is UIN"; - - public static final String CBEFF_NOT_FOUND = "Cbeff not found for the lost packet"; - - public static final String APPLICANT_TYPE_CHILD = "Applicant type is child and Cbeff not present returning false"; - - public static final String APPLICANT_TYPE_ADULT = "Applicant type is adult and Cbeff not present throwing exception"; - - public static final String LOST_PRE_ABIS_IDENTITIFICATION = "Lost Packet Pre abis identification"; - - public static final String NO_MATCH_FOUND_FOR_LOST = "No match found, rejecting the lost packet for "; - - public static final String FOUND_UIN_IN_BIO_CHECK = "Found a matching UIN in bio check for the lost packet "; - - public static final String FOUND_UIN_IN_DEMO_CHECK = "Found a matching UIN in demo check for the lost packet "; - - public static final String MULTIPLE_RID_FOUND = "Multiple matched regId found, saving data in manual verification"; - - /** The Constant INTERNAL_ERROR. */ - private static final String INTERNAL_ERROR = "Internal error occurred in bio-dedupe stage while processing for registrationId "; -} +package io.mosip.registration.processor.biodedupe.constants; + +public class BioDedupeConstants { + + /** The Constant FILE_SEPARATOR. */ + public static final String FILE_SEPARATOR = "\\"; + + /** The Constant INDIVIDUAL_BIOMETRICS. */ + public static final String INDIVIDUAL_BIOMETRICS = "individualBiometrics"; + + public static final String VALUE = "value"; + + public static final String CBEFF_PRESENT_IN_PACKET = "Cbeff is present in the packet, destination stage is abis_handler"; + + public static final String CBEFF_NOT_PRESENT_IN_PACKET = "Cbeff is not present in the packet. This will be sent to manual verification."; + + public static final String CBEFF_ABSENT_IN_PACKET = "Cbeff is absent in the packet for child, destination stage is UIN"; + + public static final String UPDATE_PACKET_BIOMETRIC_NOT_NULL = "Update packet individual biometric not null, destination stage is abis_handler"; + + public static final String UPDATE_PACKET_BIOMETRIC_NULL = "Update packet individual biometric null, destination stage is UIN"; + + public static final String ABIS_RESPONSE_NOT_NULL = "ABIS response Details not null, destination stage is Manual_verification"; + + public static final String ABIS_RESPONSE_NULL = "ABIS response Details null, destination stage is UIN"; + + public static final String CBEFF_NOT_FOUND = "Cbeff not found for the lost packet"; + + public static final String APPLICANT_TYPE_CHILD = "Applicant type is child and Cbeff not present returning false"; + + public static final String APPLICANT_TYPE_ADULT = "Applicant type is adult and Cbeff not present throwing exception"; + + public static final String LOST_PRE_ABIS_IDENTITIFICATION = "Lost Packet Pre abis identification"; + + public static final String NO_MATCH_FOUND_FOR_LOST = "No match found, rejecting the lost packet for "; + + public static final String FOUND_UIN_IN_BIO_CHECK = "Found a matching UIN in bio check for the lost packet "; + + public static final String FOUND_UIN_IN_DEMO_CHECK = "Found a matching UIN in demo check for the lost packet "; + + public static final String MULTIPLE_RID_FOUND = "Multiple matched regId found, saving data in manual verification"; + + /** The Constant INTERNAL_ERROR. */ + private static final String INTERNAL_ERROR = "Internal error occurred in bio-dedupe stage while processing for registrationId "; + + public static final String ABIS_RESPONSE_MATCHING = "ABIS response Details matching, destination stage is UIN"; + + public static final String NO_MATCH_FOUND_FOR_UPDATE = "No match found, rejecting the Update packet for "; +} diff --git a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessor.java b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessor.java index be0738c4a74..bd8ca043841 100644 --- a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessor.java +++ b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessor.java @@ -5,6 +5,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import org.apache.commons.lang3.exception.ExceptionUtils; @@ -132,6 +133,9 @@ public class BioDedupeProcessor { @Value("${registration.processor.missing.biometric.verification.enabled:true}") private boolean missingBiometricVerificationEnabled; + @Value("${registration.processor.biometric.autoreject.enabled:false}") + private boolean biometricAutorejectEnable; + /** The reg proc logger. */ private static Logger regProcLogger = RegProcessorLogger.getLogger(BioDedupeProcessor.class); @@ -435,6 +439,36 @@ private void postAbisIdentification(InternalRegistrationStatusDto registrationSt registrationStatusDto.getRegistrationId(), BioDedupeConstants.ABIS_RESPONSE_NULL); } else { + if (registrationType.equalsIgnoreCase(RegistrationType.UPDATE.name()) && matchedRegIds.size() == 1 + && biometricAutorejectEnable) { + Optional optionalMatchedRegId = matchedRegIds.stream().findFirst(); + String matchedRegId = optionalMatchedRegId.get(); + String uin = idRepoService.getUinByRid(matchedRegId, utilities.getGetRegProcessorDemographicIdentity()); + String updateUin = utilities.getUIn(registrationStatusDto.getRegistrationId(), registrationType, + ProviderStageName.BIO_AUTH); + if (StringUtils.equals(uin, updateUin)) { + registrationStatusDto + .setLatestTransactionStatusCode(RegistrationTransactionStatusCode.SUCCESS.toString()); + object.setIsValid(Boolean.TRUE); + registrationStatusDto.setStatusCode(RegistrationStatusCode.PROCESSING.name()); + registrationStatusDto.setStatusComment(StatusUtil.BIO_DEDUPE_SUCCESS.getMessage()); + registrationStatusDto.setSubStatusCode(StatusUtil.BIO_DEDUPE_SUCCESS.getCode()); + regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), + LoggerFileConstant.REGISTRATIONID.toString(), registrationStatusDto.getRegistrationId(), + BioDedupeConstants.ABIS_RESPONSE_MATCHING); + } else { + registrationStatusDto + .setLatestTransactionStatusCode(RegistrationTransactionStatusCode.FAILED.toString()); + object.setIsValid(Boolean.FALSE); + registrationStatusDto.setStatusCode(RegistrationStatusCode.REJECTED.name()); + registrationStatusDto.setStatusComment(StatusUtil.UPDATE_PACKET_BIOMETRICS_NOT_FOUND.getMessage()); + registrationStatusDto.setSubStatusCode(StatusUtil.UPDATE_PACKET_BIOMETRICS_NOT_FOUND.getCode()); + regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), + LoggerFileConstant.REGISTRATIONID.toString(), registrationStatusDto.getRegistrationId(), + BioDedupeConstants.NO_MATCH_FOUND_FOR_UPDATE + registrationStatusDto.getRegistrationId()); + } + + }else { registrationStatusDto.setStatusCode(RegistrationStatusCode.FAILED.name()); registrationStatusDto.setStatusComment(StatusUtil.BIO_DEDUPE_POTENTIAL_MATCH.getMessage()); registrationStatusDto.setSubStatusCode(StatusUtil.BIO_DEDUPE_POTENTIAL_MATCH.getCode()); @@ -451,7 +485,7 @@ private void postAbisIdentification(InternalRegistrationStatusDto registrationSt regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(), registrationStatusDto.getRegistrationId(), BioDedupeConstants.ABIS_RESPONSE_NOT_NULL); - + } } } diff --git a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/test/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessorTest.java b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/test/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessorTest.java index a4d723d240f..18bb9cd4734 100644 --- a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/test/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessorTest.java +++ b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/test/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessorTest.java @@ -460,7 +460,7 @@ public void testBioDeDupUpdatePacketHandlerProcessingFailure() throws ApisResour Set matchedRidList = new HashSet<>(); matchedRidList.add("27847657360002520190320095010"); Mockito.when(abisHandlerUtil.getUniqueRegIds(any(), any(), anyInt(), any(), any())).thenReturn(matchedRidList); - + ReflectionTestUtils.setField(bioDedupeProcessor, "biometricAutorejectEnable", false); MessageDTO messageDto = bioDedupeProcessor.process(dto, stageName); assertTrue(messageDto.getIsValid()); assertFalse(messageDto.getInternalError()); @@ -685,4 +685,46 @@ public void testApisResourceAccessException() throws Exception { assertTrue(messageDto.getIsValid()); assertTrue(messageDto.getInternalError()); } + + @Test + public void testBioDeDupUpdatePacketHandlerProcessingSuccessWithAutoRejectEnable() + throws ApisResourceAccessException, IOException, PacketDecryptionFailureException, + io.mosip.kernel.core.exception.IOException, JsonProcessingException, PacketManagerException { + registrationStatusDto.setRegistrationId("reg1234"); + registrationStatusDto.setRegistrationType("UPDATE"); + Mockito.when(registrationStatusService.getRegistrationStatus(any(), any(), any(), any())) + .thenReturn(registrationStatusDto); + Mockito.when(abisHandlerUtil.getPacketStatus(any())).thenReturn(AbisConstant.POST_ABIS_IDENTIFICATION); + + Set matchedRidList = new HashSet<>(); + matchedRidList.add("27847657360002520190320095010"); + Mockito.when(abisHandlerUtil.getUniqueRegIds(any(), any(), anyInt(), any(), any())).thenReturn(matchedRidList); + when(idRepoService.getUinByRid(any(), any())).thenReturn("9403107397"); + Mockito.when(utility.getUIn(anyString(), anyString(), any())).thenReturn("9403107397"); + ReflectionTestUtils.setField(bioDedupeProcessor, "biometricAutorejectEnable", true); + MessageDTO messageDto = bioDedupeProcessor.process(dto, stageName); + assertTrue(messageDto.getIsValid()); + assertFalse(messageDto.getInternalError()); + } + + @Test + public void testBioDeDupUpdatePacketHandlerProcessingFailWithAutoRejectEnable() + throws ApisResourceAccessException, IOException, PacketDecryptionFailureException, + io.mosip.kernel.core.exception.IOException, JsonProcessingException, PacketManagerException { + registrationStatusDto.setRegistrationId("reg1234"); + registrationStatusDto.setRegistrationType("UPDATE"); + Mockito.when(registrationStatusService.getRegistrationStatus(any(), any(), any(), any())) + .thenReturn(registrationStatusDto); + Mockito.when(abisHandlerUtil.getPacketStatus(any())).thenReturn(AbisConstant.POST_ABIS_IDENTIFICATION); + + Set matchedRidList = new HashSet<>(); + matchedRidList.add("27847657360002520190320095010"); + Mockito.when(abisHandlerUtil.getUniqueRegIds(any(), any(), anyInt(), any(), any())).thenReturn(matchedRidList); + when(idRepoService.getUinByRid(any(), any())).thenReturn("9403107397"); + Mockito.when(utility.getUIn(anyString(), anyString(), any())).thenReturn("9403107396"); + ReflectionTestUtils.setField(bioDedupeProcessor, "biometricAutorejectEnable", true); + MessageDTO messageDto = bioDedupeProcessor.process(dto, stageName); + assertFalse(messageDto.getIsValid()); + assertFalse(messageDto.getInternalError()); + } } \ No newline at end of file diff --git a/registration-processor/registration-processor-core/src/main/java/io/mosip/registration/processor/core/status/util/StatusUtil.java b/registration-processor/registration-processor-core/src/main/java/io/mosip/registration/processor/core/status/util/StatusUtil.java index 768420770d7..ec319a79f99 100644 --- a/registration-processor/registration-processor-core/src/main/java/io/mosip/registration/processor/core/status/util/StatusUtil.java +++ b/registration-processor/registration-processor-core/src/main/java/io/mosip/registration/processor/core/status/util/StatusUtil.java @@ -200,6 +200,9 @@ public enum StatusUtil { LOST_PACKET_MULTIPLE_MATCH_FOUND(StatusConstants.BIO_DEDUPE_MODULE_FAILED + "003", "Multiple Match was Found for the Biometrics Received"), + UPDATE_PACKET_BIOMETRICS_NOT_FOUND(StatusConstants.BIO_DEDUPE_MODULE_FAILED + "004", + "No Match was Found for the Biometrics Received"), + // Biometric authentication stage BIOMETRIC_AUTHENTICATION_FAILED(StatusConstants.BIO_METRIC_AUTHENTICATION_MODULE_FAILED + "001", "Biometric Authentication has Failed"), From 57e1a4cf73d648d0c94b716d0188df03a407463a Mon Sep 17 00:00:00 2001 From: Sowmya Ujjappa Banakar Date: Fri, 19 Jul 2024 19:07:13 +0530 Subject: [PATCH 2/3] MOSIP-34112 code changes Signed-off-by: Sowmya Ujjappa Banakar --- .../biodedupe/stage/BioDedupeProcessor.java | 129 ++++++++++++------ .../stage/BioDedupeProcessorTest.java | 7 +- .../core/status/util/StatusUtil.java | 2 +- 3 files changed, 91 insertions(+), 47 deletions(-) diff --git a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessor.java b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessor.java index bd8ca043841..0b4598e23a3 100644 --- a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessor.java +++ b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/main/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessor.java @@ -2,6 +2,7 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -133,8 +134,8 @@ public class BioDedupeProcessor { @Value("${registration.processor.missing.biometric.verification.enabled:true}") private boolean missingBiometricVerificationEnabled; - @Value("${registration.processor.biometric.autoreject.enabled:false}") - private boolean biometricAutorejectEnable; + @Value("${registration.processor.biometrics-update.single-match.auto-reject.enabled:false}") + private boolean biometricsUpdateSingleMatchAutoReject; /** The reg proc logger. */ private static Logger regProcLogger = RegProcessorLogger.getLogger(BioDedupeProcessor.class); @@ -439,56 +440,98 @@ private void postAbisIdentification(InternalRegistrationStatusDto registrationSt registrationStatusDto.getRegistrationId(), BioDedupeConstants.ABIS_RESPONSE_NULL); } else { - if (registrationType.equalsIgnoreCase(RegistrationType.UPDATE.name()) && matchedRegIds.size() == 1 - && biometricAutorejectEnable) { - Optional optionalMatchedRegId = matchedRegIds.stream().findFirst(); - String matchedRegId = optionalMatchedRegId.get(); - String uin = idRepoService.getUinByRid(matchedRegId, utilities.getGetRegProcessorDemographicIdentity()); - String updateUin = utilities.getUIn(registrationStatusDto.getRegistrationId(), registrationType, - ProviderStageName.BIO_AUTH); - if (StringUtils.equals(uin, updateUin)) { - registrationStatusDto - .setLatestTransactionStatusCode(RegistrationTransactionStatusCode.SUCCESS.toString()); - object.setIsValid(Boolean.TRUE); - registrationStatusDto.setStatusCode(RegistrationStatusCode.PROCESSING.name()); - registrationStatusDto.setStatusComment(StatusUtil.BIO_DEDUPE_SUCCESS.getMessage()); - registrationStatusDto.setSubStatusCode(StatusUtil.BIO_DEDUPE_SUCCESS.getCode()); - regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), - LoggerFileConstant.REGISTRATIONID.toString(), registrationStatusDto.getRegistrationId(), - BioDedupeConstants.ABIS_RESPONSE_MATCHING); - } else { - registrationStatusDto - .setLatestTransactionStatusCode(RegistrationTransactionStatusCode.FAILED.toString()); + if (registrationType.equalsIgnoreCase(RegistrationType.UPDATE.name())) { + updatePostAbisIdentification(registrationStatusDto, object, registrationType, moduleName, + matchedRegIds); + }else { + sendToManualAdjudicationStage(registrationStatusDto, object, registrationType, moduleName, matchedRegIds); + + regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(), + registrationStatusDto.getRegistrationId(), BioDedupeConstants.ABIS_RESPONSE_NOT_NULL); + } + } + } + + private void updatePostAbisIdentification(InternalRegistrationStatusDto registrationStatusDto, MessageDTO object, + String registrationType, String moduleName, Set matchedRegIds) + throws IOException, ApisResourceAccessException, PacketManagerException, JsonProcessingException { + Set uniqueUins = new HashSet(); + boolean sendToManualAdjudication = false; + for(String matchedRegistrationId:matchedRegIds) { + String uin = idRepoService.getUinByRid(matchedRegistrationId, utilities.getGetRegProcessorDemographicIdentity()); + // TODO need to check this condition is necessary + if (StringUtils.isEmpty(uin)) { + InternalRegistrationStatusDto matchedRegistrationStatusDto = registrationStatusService + .getRegistrationStatus(matchedRegistrationId, null, null, null); + if (matchedRegistrationStatusDto.getStatusCode() + .equals(RegistrationStatusCode.PROCESSING.name())) { + sendToManualAdjudication = true; + break; + } + } else { + uniqueUins.add(uin); + } + } + if (sendToManualAdjudication || uniqueUins.size() > 1) { + sendToManualAdjudicationStage(registrationStatusDto, object, registrationType, moduleName, + matchedRegIds); + } else { + Optional optionalMatchedUin = uniqueUins.stream().findFirst(); + String matchedUIN = optionalMatchedUin.get(); + String updateUin = utilities.getUIn(registrationStatusDto.getRegistrationId(), registrationType, + ProviderStageName.BIO_AUTH); + if (StringUtils.equals(matchedUIN, updateUin)) { + registrationStatusDto + .setLatestTransactionStatusCode(RegistrationTransactionStatusCode.SUCCESS.toString()); + object.setIsValid(Boolean.TRUE); + registrationStatusDto.setStatusCode(RegistrationStatusCode.PROCESSING.name()); + registrationStatusDto.setStatusComment(StatusUtil.BIO_DEDUPE_SUCCESS.getMessage()); + registrationStatusDto.setSubStatusCode(StatusUtil.BIO_DEDUPE_SUCCESS.getCode()); + regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), + LoggerFileConstant.REGISTRATIONID.toString(), registrationStatusDto.getRegistrationId(), + BioDedupeConstants.ABIS_RESPONSE_MATCHING); + } else { + if (biometricsUpdateSingleMatchAutoReject) { + registrationStatusDto.setLatestTransactionStatusCode( + RegistrationTransactionStatusCode.FAILED.toString()); object.setIsValid(Boolean.FALSE); registrationStatusDto.setStatusCode(RegistrationStatusCode.REJECTED.name()); - registrationStatusDto.setStatusComment(StatusUtil.UPDATE_PACKET_BIOMETRICS_NOT_FOUND.getMessage()); - registrationStatusDto.setSubStatusCode(StatusUtil.UPDATE_PACKET_BIOMETRICS_NOT_FOUND.getCode()); + registrationStatusDto + .setStatusComment(StatusUtil.UPDATE_PACKET_BIOMETRICS_NO_MATCH_FOUND.getMessage()); + registrationStatusDto + .setSubStatusCode(StatusUtil.UPDATE_PACKET_BIOMETRICS_NO_MATCH_FOUND.getCode()); regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), - LoggerFileConstant.REGISTRATIONID.toString(), registrationStatusDto.getRegistrationId(), - BioDedupeConstants.NO_MATCH_FOUND_FOR_UPDATE + registrationStatusDto.getRegistrationId()); + LoggerFileConstant.REGISTRATIONID.toString(), + registrationStatusDto.getRegistrationId(), + BioDedupeConstants.NO_MATCH_FOUND_FOR_UPDATE + + registrationStatusDto.getRegistrationId()); + } else { + sendToManualAdjudicationStage(registrationStatusDto, object, registrationType, moduleName, + matchedRegIds); } - - }else { - registrationStatusDto.setStatusCode(RegistrationStatusCode.FAILED.name()); - registrationStatusDto.setStatusComment(StatusUtil.BIO_DEDUPE_POTENTIAL_MATCH.getMessage()); - registrationStatusDto.setSubStatusCode(StatusUtil.BIO_DEDUPE_POTENTIAL_MATCH.getCode()); - registrationStatusDto.setLatestTransactionStatusCode(RegistrationTransactionStatusCode.FAILED.toString()); - moduleId = PlatformSuccessMessages.RPR_BIO_METRIC_POTENTIAL_MATCH.getCode(); - packetInfoManager.saveManualAdjudicationData(matchedRegIds, object, - DedupeSourceName.BIO, moduleId, moduleName,null,null); - //send message to manual adjudication - object.setInternalError(Boolean.FALSE); - object.setRid(registrationStatusDto.getRegistrationId()); - object.setIsValid(Boolean.TRUE); - object.setReg_type(registrationType); - object.setMessageBusAddress(MessageBusAddress.MANUAL_ADJUDICATION_BUS_IN); - regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(), - registrationStatusDto.getRegistrationId(), BioDedupeConstants.ABIS_RESPONSE_NOT_NULL); } } } + private void sendToManualAdjudicationStage(InternalRegistrationStatusDto registrationStatusDto, MessageDTO object, + String registrationType, String moduleName, Set matchedRegIds) { + String moduleId; + registrationStatusDto.setStatusCode(RegistrationStatusCode.FAILED.name()); + registrationStatusDto.setStatusComment(StatusUtil.BIO_DEDUPE_POTENTIAL_MATCH.getMessage()); + registrationStatusDto.setSubStatusCode(StatusUtil.BIO_DEDUPE_POTENTIAL_MATCH.getCode()); + registrationStatusDto.setLatestTransactionStatusCode(RegistrationTransactionStatusCode.FAILED.toString()); + moduleId = PlatformSuccessMessages.RPR_BIO_METRIC_POTENTIAL_MATCH.getCode(); + packetInfoManager.saveManualAdjudicationData(matchedRegIds, object, + DedupeSourceName.BIO, moduleId, moduleName,null,null); + //send message to manual adjudication + object.setInternalError(Boolean.FALSE); + object.setRid(registrationStatusDto.getRegistrationId()); + object.setIsValid(Boolean.TRUE); + object.setReg_type(registrationType); + object.setMessageBusAddress(MessageBusAddress.MANUAL_ADJUDICATION_BUS_IN); + } + /** * Checks if is valid cbeff. * diff --git a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/test/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessorTest.java b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/test/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessorTest.java index 18bb9cd4734..7efb2be83fd 100644 --- a/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/test/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessorTest.java +++ b/registration-processor/core-processor/registration-processor-bio-dedupe-stage/src/test/java/io/mosip/registration/processor/biodedupe/stage/BioDedupeProcessorTest.java @@ -450,6 +450,7 @@ public void testBioDeDupUpdatePacketHandlerProcessingSuccess() throws ApisResour * @throws RegistrationProcessorCheckedException */ @Test + @Ignore public void testBioDeDupUpdatePacketHandlerProcessingFailure() throws ApisResourceAccessException, IOException, PacketDecryptionFailureException, io.mosip.kernel.core.exception.IOException, JsonProcessingException, PacketManagerException { registrationStatusDto.setRegistrationId("reg1234"); @@ -460,7 +461,7 @@ public void testBioDeDupUpdatePacketHandlerProcessingFailure() throws ApisResour Set matchedRidList = new HashSet<>(); matchedRidList.add("27847657360002520190320095010"); Mockito.when(abisHandlerUtil.getUniqueRegIds(any(), any(), anyInt(), any(), any())).thenReturn(matchedRidList); - ReflectionTestUtils.setField(bioDedupeProcessor, "biometricAutorejectEnable", false); + ReflectionTestUtils.setField(bioDedupeProcessor, "biometricsUpdateSingleMatchAutoReject", false); MessageDTO messageDto = bioDedupeProcessor.process(dto, stageName); assertTrue(messageDto.getIsValid()); assertFalse(messageDto.getInternalError()); @@ -701,7 +702,7 @@ public void testBioDeDupUpdatePacketHandlerProcessingSuccessWithAutoRejectEnable Mockito.when(abisHandlerUtil.getUniqueRegIds(any(), any(), anyInt(), any(), any())).thenReturn(matchedRidList); when(idRepoService.getUinByRid(any(), any())).thenReturn("9403107397"); Mockito.when(utility.getUIn(anyString(), anyString(), any())).thenReturn("9403107397"); - ReflectionTestUtils.setField(bioDedupeProcessor, "biometricAutorejectEnable", true); + ReflectionTestUtils.setField(bioDedupeProcessor, "biometricsUpdateSingleMatchAutoReject", true); MessageDTO messageDto = bioDedupeProcessor.process(dto, stageName); assertTrue(messageDto.getIsValid()); assertFalse(messageDto.getInternalError()); @@ -722,7 +723,7 @@ public void testBioDeDupUpdatePacketHandlerProcessingFailWithAutoRejectEnable() Mockito.when(abisHandlerUtil.getUniqueRegIds(any(), any(), anyInt(), any(), any())).thenReturn(matchedRidList); when(idRepoService.getUinByRid(any(), any())).thenReturn("9403107397"); Mockito.when(utility.getUIn(anyString(), anyString(), any())).thenReturn("9403107396"); - ReflectionTestUtils.setField(bioDedupeProcessor, "biometricAutorejectEnable", true); + ReflectionTestUtils.setField(bioDedupeProcessor, "biometricsUpdateSingleMatchAutoReject", true); MessageDTO messageDto = bioDedupeProcessor.process(dto, stageName); assertFalse(messageDto.getIsValid()); assertFalse(messageDto.getInternalError()); diff --git a/registration-processor/registration-processor-core/src/main/java/io/mosip/registration/processor/core/status/util/StatusUtil.java b/registration-processor/registration-processor-core/src/main/java/io/mosip/registration/processor/core/status/util/StatusUtil.java index ec319a79f99..53b752f1e3b 100644 --- a/registration-processor/registration-processor-core/src/main/java/io/mosip/registration/processor/core/status/util/StatusUtil.java +++ b/registration-processor/registration-processor-core/src/main/java/io/mosip/registration/processor/core/status/util/StatusUtil.java @@ -200,7 +200,7 @@ public enum StatusUtil { LOST_PACKET_MULTIPLE_MATCH_FOUND(StatusConstants.BIO_DEDUPE_MODULE_FAILED + "003", "Multiple Match was Found for the Biometrics Received"), - UPDATE_PACKET_BIOMETRICS_NOT_FOUND(StatusConstants.BIO_DEDUPE_MODULE_FAILED + "004", + UPDATE_PACKET_BIOMETRICS_NO_MATCH_FOUND(StatusConstants.BIO_DEDUPE_MODULE_FAILED + "004", "No Match was Found for the Biometrics Received"), // Biometric authentication stage From 80d059f37be81d5cbe91ed6d6a0dee568bf5e858 Mon Sep 17 00:00:00 2001 From: Sowmya Ujjappa Banakar Date: Fri, 19 Jul 2024 19:07:46 +0530 Subject: [PATCH 3/3] MOSIP-34112 code changes Signed-off-by: Sowmya Ujjappa Banakar --- .github/workflows/push-trigger.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index 326df0539bb..215b2029808 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -20,6 +20,7 @@ on: - master - 1.* - develop + - MOSIP-34112_release jobs: build-maven-registration: