From 7626fb35997bbc905e35ae238134cf352568d43c Mon Sep 17 00:00:00 2001 From: kameshsr Date: Thu, 16 Jan 2025 19:18:06 +0530 Subject: [PATCH 1/5] MOSIP-39000 Fixed print uin issue Signed-off-by: kameshsr --- .../service/impl/ResidentServiceImpl.java | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java index 6c3f7dc7f6..d173eb20d8 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java @@ -545,7 +545,7 @@ public ResidentReprintResponseDto reqPrintUin(ResidentReprintRequestDto dto) RegProcRePrintRequestDto rePrintReq = new RegProcRePrintRequestDto(); rePrintReq.setCardType(dto.getCardType()); rePrintReq.setCenterId(centerId); - rePrintReq.setMachineId(machineId); + rePrintReq.setMachineId(getMachineId()); rePrintReq.setId(dto.getIndividualId()); rePrintReq.setIdType(dto.getIndividualIdType()); rePrintReq.setReason("resident"); @@ -862,20 +862,11 @@ public Tuple2 reqUinUpdate(ResidentUpdateRequestDto dto, JSONObj logger.debug(AuditEnum.VALIDATE_OTP_SUCCESS.getDescription(), dto.getTransactionID()); } - final String publicKey = getPublicKeyFromKeyManager(); - MachineSearchResponseDTO machineSearchResponseDTO = searchMachineInMasterService(residentMachinePrefix, - publicKey); - String machineId = getMachineId(machineSearchResponseDTO, publicKey); - if (machineId == null) { - machineId = createNewMachineInMasterService(residentMachinePrefix, machineSpecId, zoneCode, centerId, - publicKey); - } - ResidentUpdateDto regProcReqUpdateDto = new ResidentUpdateDto(); regProcReqUpdateDto.setIdValue(dto.getIndividualId()); regProcReqUpdateDto.setIdType(ResidentIndividialIDType.valueOf(dto.getIndividualIdType().toUpperCase())); regProcReqUpdateDto.setCenterId(centerId); - regProcReqUpdateDto.setMachineId(machineId); + regProcReqUpdateDto.setMachineId(getMachineId()); JSONObject jsonObject = new JSONObject(); jsonObject.put(IDENTITY, demographicIdentity); String encodedIdentityJson = CryptoUtil.encodeToURLSafeBase64(jsonObject.toJSONString().getBytes()); @@ -1079,6 +1070,41 @@ public Tuple2 reqUinUpdate(ResidentUpdateRequestDto dto, JSONObj return Tuples.of(responseDto, eventId); } + private String getMachineId() throws ApisResourceAccessException { + final String publicKey = getPublicKeyFromKeyManager(); + MachineSearchResponseDTO machineSearchResponseDTO = searchMachineInMasterService(residentMachinePrefix, + publicKey); + String machineId = getMachineIdIfExists(machineSearchResponseDTO, publicKey); + if (machineId == null) { + machineId = createNewMachineInMasterService(residentMachinePrefix, machineSpecId, zoneCode, centerId, + publicKey); + } + //activateMachineId(machineId); + return machineId; + } + +// private void activateMachineId(String machineId) { +// +// try { +// +// machineSearchResponseDTO = residentServiceRestClient.postApi(env.getProperty(ApiName.MACHINESEARCH.name()), +// MediaType.APPLICATION_JSON, httpEntity, MachineSearchResponseDTO.class); +// logger.debug(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.USERID.toString(), +// residentMachinePrefix, +// "ResidentServiceImpl::reqUinUpdate():: MACHINESEARCH POST service call ended with response data " +// + machineSearchResponseDTO.toString()); +// if (machineSearchResponseDTO.getErrors() != null && !machineSearchResponseDTO.getErrors().isEmpty()) { +// throw new ResidentMachineServiceException(machineSearchResponseDTO.getErrors().get(0).getErrorCode(), +// machineSearchResponseDTO.getErrors().get(0).getMessage()); +// } +// } catch (Exception e) { +// logger.error(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.USERID.toString(), +// residentMachinePrefix, "ResidentServiceImpl::reqUinUpdate():: MACHINESEARCH POST service call" +// + ExceptionUtils.getStackTrace(e)); +// throw new ApisResourceAccessException("Could not fetch machines from master data", e); +// } +// } + private void sendFailureNotification(ResidentTransactionEntity residentTransactionEntity, ResidentUpdateRequestDto dto, JSONObject idRepoJson) throws ResidentServiceCheckedException { if (Utility.isSecureSession()) { residentTransactionEntity.setStatusCode(EventStatusFailure.FAILED.name()); @@ -1369,7 +1395,7 @@ private MachineSearchResponseDTO searchMachineInMasterService(String residentMac return machineSearchResponseDTO; } - private String getMachineId(MachineSearchResponseDTO machineSearchResponseDTO, final String publicKey) { + private String getMachineIdIfExists(MachineSearchResponseDTO machineSearchResponseDTO, final String publicKey) { if (machineSearchResponseDTO.getResponse() != null) { List fetchedMachines = machineSearchResponseDTO.getResponse().getData(); if (fetchedMachines != null && !fetchedMachines.isEmpty()) { From ac361cb409c38c3be15222b819b1c75f7dfb1c5b Mon Sep 17 00:00:00 2001 From: kameshsr Date: Fri, 17 Jan 2025 12:54:36 +0530 Subject: [PATCH 2/5] MOSIP-39000 Added update machine Signed-off-by: kameshsr --- .../io/mosip/resident/constant/ApiName.java | 1 + .../mosip/resident/dto/StatusResponseDto.java | 14 +++ .../service/impl/ResidentServiceImpl.java | 89 +++++-------------- 3 files changed, 35 insertions(+), 69 deletions(-) create mode 100644 resident/resident-service/src/main/java/io/mosip/resident/dto/StatusResponseDto.java diff --git a/resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java b/resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java index 1265fd680a..477a728c95 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java @@ -58,6 +58,7 @@ public enum ApiName { PACKETSIGNPUBLICKEY, MACHINESEARCH, MACHINECREATE, + MACHINEUPDATE, PARTNER_API_URL, DECRYPT_API_URL, OTP_GEN_URL, POLICY_REQ_URL, diff --git a/resident/resident-service/src/main/java/io/mosip/resident/dto/StatusResponseDto.java b/resident/resident-service/src/main/java/io/mosip/resident/dto/StatusResponseDto.java new file mode 100644 index 0000000000..5ba68ef0be --- /dev/null +++ b/resident/resident-service/src/main/java/io/mosip/resident/dto/StatusResponseDto.java @@ -0,0 +1,14 @@ +package io.mosip.resident.dto; + +/* + * @author Kamesh Shekhar Prasad + */ + +import lombok.Data; + +@Data +public class StatusResponseDto { + + private String status; +} + diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java index d173eb20d8..55ac569748 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java @@ -37,6 +37,7 @@ import java.util.stream.IntStream; import java.util.stream.Stream; +import io.mosip.resident.dto.*; import io.mosip.resident.util.*; import io.mosip.resident.validator.ValidateNewUpdateRequest; import io.mosip.resident.validator.ValidateSameData; @@ -86,53 +87,6 @@ import io.mosip.resident.constant.ServiceType; import io.mosip.resident.constant.TemplateType; import io.mosip.resident.constant.TemplateVariablesConstants; -import io.mosip.resident.dto.AidStatusRequestDTO; -import io.mosip.resident.dto.AidStatusResponseDTO; -import io.mosip.resident.dto.AuthHistoryRequestDTO; -import io.mosip.resident.dto.AuthHistoryResponseDTO; -import io.mosip.resident.dto.AuthLockOrUnLockRequestDto; -import io.mosip.resident.dto.AuthLockOrUnLockRequestDtoV2; -import io.mosip.resident.dto.AuthLockStatusResponseDtoV2; -import io.mosip.resident.dto.AuthTxnDetailsDTO; -import io.mosip.resident.dto.AuthTypeStatusDtoV2; -import io.mosip.resident.dto.AuthUnLockRequestDTO; -import io.mosip.resident.dto.BellNotificationDto; -import io.mosip.resident.dto.DocumentResponseDTO; -import io.mosip.resident.dto.EuinRequestDTO; -import io.mosip.resident.dto.EventStatusResponseDTO; -import io.mosip.resident.dto.IdResponseDTO1; -import io.mosip.resident.dto.IdentityDTO; -import io.mosip.resident.dto.MachineCreateRequestDTO; -import io.mosip.resident.dto.MachineCreateResponseDTO; -import io.mosip.resident.dto.MachineDto; -import io.mosip.resident.dto.MachineSearchRequestDTO; -import io.mosip.resident.dto.MachineSearchResponseDTO; -import io.mosip.resident.dto.NotificationRequestDto; -import io.mosip.resident.dto.NotificationRequestDtoV2; -import io.mosip.resident.dto.NotificationResponseDTO; -import io.mosip.resident.dto.PacketGeneratorResDto; -import io.mosip.resident.dto.PacketSignPublicKeyRequestDTO; -import io.mosip.resident.dto.PacketSignPublicKeyResponseDTO; -import io.mosip.resident.dto.PageDto; -import io.mosip.resident.dto.RegProcRePrintRequestDto; -import io.mosip.resident.dto.RegStatusCheckResponseDTO; -import io.mosip.resident.dto.RegistrationStatusRequestDTO; -import io.mosip.resident.dto.RegistrationStatusResponseDTO; -import io.mosip.resident.dto.RegistrationStatusSubRequestDto; -import io.mosip.resident.dto.RegistrationType; -import io.mosip.resident.dto.RequestDTO; -import io.mosip.resident.dto.ResidentDocuments; -import io.mosip.resident.dto.ResidentIndividialIDType; -import io.mosip.resident.dto.ResidentReprintRequestDto; -import io.mosip.resident.dto.ResidentReprintResponseDto; -import io.mosip.resident.dto.ResidentUpdateDto; -import io.mosip.resident.dto.ResidentUpdateRequestDto; -import io.mosip.resident.dto.ResidentUpdateResponseDTO; -import io.mosip.resident.dto.ResidentUpdateResponseDTOV2; -import io.mosip.resident.dto.ResponseDTO; -import io.mosip.resident.dto.ServiceHistoryResponseDto; -import io.mosip.resident.dto.UnreadNotificationDto; -import io.mosip.resident.dto.UserInfoDto; import io.mosip.resident.entity.ResidentSessionEntity; import io.mosip.resident.entity.ResidentTransactionEntity; import io.mosip.resident.entity.ResidentUserEntity; @@ -1079,31 +1033,28 @@ private String getMachineId() throws ApisResourceAccessException { machineId = createNewMachineInMasterService(residentMachinePrefix, machineSpecId, zoneCode, centerId, publicKey); } - //activateMachineId(machineId); + activateMachineId(machineId); return machineId; } -// private void activateMachineId(String machineId) { -// -// try { -// -// machineSearchResponseDTO = residentServiceRestClient.postApi(env.getProperty(ApiName.MACHINESEARCH.name()), -// MediaType.APPLICATION_JSON, httpEntity, MachineSearchResponseDTO.class); -// logger.debug(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.USERID.toString(), -// residentMachinePrefix, -// "ResidentServiceImpl::reqUinUpdate():: MACHINESEARCH POST service call ended with response data " -// + machineSearchResponseDTO.toString()); -// if (machineSearchResponseDTO.getErrors() != null && !machineSearchResponseDTO.getErrors().isEmpty()) { -// throw new ResidentMachineServiceException(machineSearchResponseDTO.getErrors().get(0).getErrorCode(), -// machineSearchResponseDTO.getErrors().get(0).getMessage()); -// } -// } catch (Exception e) { -// logger.error(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.USERID.toString(), -// residentMachinePrefix, "ResidentServiceImpl::reqUinUpdate():: MACHINESEARCH POST service call" -// + ExceptionUtils.getStackTrace(e)); -// throw new ApisResourceAccessException("Could not fetch machines from master data", e); -// } -// } + private void activateMachineId(String machineId) throws ApisResourceAccessException { + + try { + ResponseWrapper response = + residentServiceRestClient.patchApi(env.getProperty(ApiName.MACHINESEARCH.name()) + , MediaType.APPLICATION_JSON, null, + ResponseWrapper.class); + if (response.getErrors() != null && !response.getErrors().isEmpty()) { + throw new ResidentMachineServiceException(response.getErrors().get(0).getErrorCode(), + response.getErrors().get(0).getMessage()); + } + } catch (Exception e) { + logger.error(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.USERID.toString(), + residentMachinePrefix, "ResidentServiceImpl::reqUinUpdate():: activateMachineId Patch service call" + + ExceptionUtils.getStackTrace(e)); + throw new ApisResourceAccessException("Could not active machines in master data", e); + } + } private void sendFailureNotification(ResidentTransactionEntity residentTransactionEntity, ResidentUpdateRequestDto dto, JSONObject idRepoJson) throws ResidentServiceCheckedException { if (Utility.isSecureSession()) { From fbd51975a60481e553c0e32882cdd414d1ac6ac0 Mon Sep 17 00:00:00 2001 From: kameshsr Date: Fri, 17 Jan 2025 15:14:20 +0530 Subject: [PATCH 3/5] MOSIP-39000 Added api to update machine Signed-off-by: kameshsr --- .../service/impl/ResidentServiceImpl.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java index 55ac569748..a3c6822fb3 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java @@ -111,6 +111,7 @@ import io.mosip.resident.service.NotificationService; import io.mosip.resident.service.PartnerService; import io.mosip.resident.service.ResidentService; +import org.springframework.web.util.UriComponentsBuilder; import reactor.util.function.Tuple2; import reactor.util.function.Tuples; @@ -1038,12 +1039,18 @@ private String getMachineId() throws ApisResourceAccessException { } private void activateMachineId(String machineId) throws ApisResourceAccessException { - try { + String baseUrl = env.getProperty(ApiName.MACHINEUPDATE.name()); + + String apiUrl = UriComponentsBuilder.fromHttpUrl(baseUrl) + .queryParam("id", machineId) + .queryParam("isActive", true) + .toUriString(); + ResponseWrapper response = - residentServiceRestClient.patchApi(env.getProperty(ApiName.MACHINESEARCH.name()) - , MediaType.APPLICATION_JSON, null, - ResponseWrapper.class); + residentServiceRestClient.patchApi(apiUrl, MediaType.APPLICATION_JSON, null, + ResponseWrapper.class); + if (response.getErrors() != null && !response.getErrors().isEmpty()) { throw new ResidentMachineServiceException(response.getErrors().get(0).getErrorCode(), response.getErrors().get(0).getMessage()); @@ -1052,10 +1059,11 @@ private void activateMachineId(String machineId) throws ApisResourceAccessExcept logger.error(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.USERID.toString(), residentMachinePrefix, "ResidentServiceImpl::reqUinUpdate():: activateMachineId Patch service call" + ExceptionUtils.getStackTrace(e)); - throw new ApisResourceAccessException("Could not active machines in master data", e); + throw new ApisResourceAccessException("Could not activate machines in master data", e); } } + private void sendFailureNotification(ResidentTransactionEntity residentTransactionEntity, ResidentUpdateRequestDto dto, JSONObject idRepoJson) throws ResidentServiceCheckedException { if (Utility.isSecureSession()) { residentTransactionEntity.setStatusCode(EventStatusFailure.FAILED.name()); From 40334a3fded0f24cab899649b1bca54c7befd253 Mon Sep 17 00:00:00 2001 From: kameshsr Date: Tue, 21 Jan 2025 20:37:34 +0530 Subject: [PATCH 4/5] MOSIP-39000 Fixed req print test case Signed-off-by: kameshsr --- .../impl/ResidentServiceReqReprintTest.java | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentServiceReqReprintTest.java b/resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentServiceReqReprintTest.java index 8723d1148b..bc29083140 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentServiceReqReprintTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentServiceReqReprintTest.java @@ -2,12 +2,16 @@ import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; +import io.mosip.resident.constant.ApiName; +import io.mosip.resident.util.Utilities; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -16,7 +20,9 @@ import org.mockito.Mockito; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.core.env.Environment; +import org.springframework.http.HttpEntity; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpServerErrorException; @@ -31,6 +37,9 @@ import io.mosip.resident.dto.ResidentReprintRequestDto; import io.mosip.resident.dto.ResidentReprintResponseDto; import io.mosip.resident.dto.ResponseWrapper; +import io.mosip.resident.dto.MachineDto; +import io.mosip.resident.dto.MachineSearchResponseDTO; +import io.mosip.resident.dto.PacketSignPublicKeyResponseDTO; import io.mosip.resident.exception.ApisResourceAccessException; import io.mosip.resident.exception.OtpValidationFailedException; import io.mosip.resident.exception.ResidentServiceCheckedException; @@ -67,6 +76,9 @@ public class ResidentServiceReqReprintTest { @Mock NotificationService notificationService; + + @Mock + private Utilities utilities; private ResidentReprintRequestDto residentReqDto; @@ -87,7 +99,7 @@ public void setUp() throws IOException, BaseCheckedException { } @Test - public void reqPrintUinTest() throws ResidentServiceCheckedException { + public void reqPrintUinTest() throws ResidentServiceCheckedException, ApisResourceAccessException { RegProcCommonResponseDto reprintResp = new RegProcCommonResponseDto(); reprintResp.setMessage("sent to packet receiver"); @@ -96,6 +108,47 @@ public void reqPrintUinTest() throws ResidentServiceCheckedException { NotificationResponseDTO notificationResponse = new NotificationResponseDTO(); notificationResponse.setMessage("Notification sent to registered contact details"); notificationResponse.setStatus("success"); + + String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuGXPqbFOIZhB_N_fbTXOMIsRgq_LMdL9DJ5kWYAneCj_LPw3OEm2ncLVIRyJsF2DcSQwvzt_Njdvg1Cr54nD1uHBu3Vt9G1sy3p6uwbeK1l5mJSMNe5oGe11fmehtsR2QcB_45_us_IiiiUzzHJrySexmDfdOiPdy-dID4DYRDAf-HXlMIEf4Di_8NV3wVrA3jq1tuNkXX3qKtM4NhZOihp0HmB9E7RHttSV9VJNh00BrC57qdMfa5xqsHok3qftU5SAan4BGuPklN2fzOVcsa-V-B8JbwxRfPdwMkq-jW7Eu1LcNhNVQYJGEWDLAQDGKY_fOB_YwBzn8xvYRjqSfQIDAQAB"; + List machineDtos = new ArrayList<>(); + MachineDto machineDto = new MachineDto(); + machineDto.setMachineSpecId("1001"); + machineDto.setIsActive(false); + machineDto.setId("10147"); + machineDto.setName("resident_machine_1640777004542"); + machineDto.setValidityDateTime("2024-12-29T11:23:24.541Z"); + machineDto.setPublicKey(publicKey); + machineDto.setSignPublicKey(publicKey); + machineDtos.add(machineDto); + MachineSearchResponseDTO.MachineSearchDto response = MachineSearchResponseDTO.MachineSearchDto.builder() + .fromRecord(0).toRecord(0).toRecord(0).data(machineDtos).build(); + MachineSearchResponseDTO machineSearchResponseDTO = new MachineSearchResponseDTO(); + machineSearchResponseDTO.setId("null"); + machineSearchResponseDTO.setVersion("1.0"); + machineSearchResponseDTO.setResponsetime("2022-01-28T06:25:23.958Z"); + machineSearchResponseDTO.setResponse(response); + + PacketSignPublicKeyResponseDTO responseDto = new PacketSignPublicKeyResponseDTO(); + PacketSignPublicKeyResponseDTO.PacketSignPublicKeyResponse publicKeyResponse = new PacketSignPublicKeyResponseDTO.PacketSignPublicKeyResponse(); + publicKeyResponse.setPublicKey(publicKey); + responseDto.setId(null); + responseDto.setVersion(null); + responseDto.setResponsetime("2022-01-28T06:51:30.286Z"); + responseDto.setResponse(publicKeyResponse); + responseDto.setErrors(new ArrayList<>()); + + Mockito.when(env.getProperty(ApiName.PACKETSIGNPUBLICKEY.name())).thenReturn("PACKETSIGNPUBLICKEY"); + Mockito.when(env.getProperty(ApiName.MACHINESEARCH.name())).thenReturn("MACHINESEARCH"); + Mockito.when(env.getProperty(ApiName.MACHINEUPDATE.name())).thenReturn("http://localhost"); + + Mockito.when(residentServiceRestClient.postApi(eq("PACKETSIGNPUBLICKEY"), any(MediaType.class), + any(HttpEntity.class), eq(PacketSignPublicKeyResponseDTO.class))).thenReturn(responseDto); + Mockito.when(residentServiceRestClient.postApi(eq("MACHINESEARCH"), any(MediaType.class), any(HttpEntity.class), + eq(MachineSearchResponseDTO.class))).thenReturn(machineSearchResponseDTO); + when(residentServiceRestClient.patchApi(any(), any(), any(), any())).thenReturn(new io.mosip.kernel.core.http.ResponseWrapper<>()); + + when(utilities.getLanguageCode()).thenReturn("eng"); + Mockito.when(notificationService.sendNotification(any(), Mockito.nullable(Map.class))).thenReturn(notificationResponse); ResidentReprintResponseDto residentResponse = residentServiceImpl.reqPrintUin(residentReqDto); assertEquals("10008200070004620191203115734", residentResponse.getRegistrationId()); From e425401b8cfc8df69e10500565d2cb409785d8da Mon Sep 17 00:00:00 2001 From: kameshsr Date: Tue, 21 Jan 2025 20:42:53 +0530 Subject: [PATCH 5/5] MOSIP-39000 fixed unit test case failures Signed-off-by: kameshsr --- .../resident/service/impl/ResidentServiceResUpdateTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentServiceResUpdateTest.java b/resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentServiceResUpdateTest.java index 40554bf6fe..1211934afc 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentServiceResUpdateTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentServiceResUpdateTest.java @@ -227,6 +227,9 @@ public void setUp() throws BaseCheckedException, IOException { notificationResponse.setStatus("success"); Mockito.when(notificationService.sendNotification(any(), Mockito.nullable(Map.class))).thenReturn(notificationResponse); + Mockito.when(env.getProperty(ApiName.MACHINEUPDATE.name())).thenReturn("http://localhost"); + when(residentServiceRestClient.patchApi(any(), any(), any(), any())).thenReturn(new io.mosip.kernel.core.http.ResponseWrapper<>()); + String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuGXPqbFOIZhB_N_fbTXOMIsRgq_LMdL9DJ5kWYAneCj_LPw3OEm2ncLVIRyJsF2DcSQwvzt_Njdvg1Cr54nD1uHBu3Vt9G1sy3p6uwbeK1l5mJSMNe5oGe11fmehtsR2QcB_45_us_IiiiUzzHJrySexmDfdOiPdy-dID4DYRDAf-HXlMIEf4Di_8NV3wVrA3jq1tuNkXX3qKtM4NhZOihp0HmB9E7RHttSV9VJNh00BrC57qdMfa5xqsHok3qftU5SAan4BGuPklN2fzOVcsa-V-B8JbwxRfPdwMkq-jW7Eu1LcNhNVQYJGEWDLAQDGKY_fOB_YwBzn8xvYRjqSfQIDAQAB"; List machineDtos = new ArrayList<>(); MachineDto machineDto = new MachineDto();