diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/AuthTransactionCallbackControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/AuthTransactionCallbackControllerTest.java index defd899130d..11c36e697b9 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/AuthTransactionCallbackControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/AuthTransactionCallbackControllerTest.java @@ -6,6 +6,7 @@ import io.mosip.resident.controller.VerificationController; import io.mosip.resident.helper.ObjectStoreHelper; import io.mosip.resident.service.*; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.service.impl.VerificationServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; @@ -73,6 +74,9 @@ public class AuthTransactionCallbackControllerTest { @MockBean private ObjectStoreHelper objectStore; + + @MockBean + private ResidentServiceImpl residentService; @MockBean private VerificationServiceImpl verificationServiceImpl; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/DownloadCardControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/DownloadCardControllerTest.java index bb83d4b831f..13fa15e6122 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/DownloadCardControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/DownloadCardControllerTest.java @@ -43,6 +43,7 @@ import io.mosip.resident.service.DownloadCardService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.impl.IdentityServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; import io.mosip.resident.util.Utility; @@ -93,6 +94,9 @@ public class DownloadCardControllerTest { @MockBean private ResidentVidService vidService; + + @MockBean + private ResidentServiceImpl residentService; @MockBean private CryptoCoreSpec encryptor; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/DownloadMasterdataControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/DownloadMasterdataControllerTest.java index 5bdc6e016cd..f4a541f3f0c 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/DownloadMasterdataControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/DownloadMasterdataControllerTest.java @@ -10,6 +10,7 @@ import io.mosip.resident.service.DownLoadMasterDataService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.impl.IdentityServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; import io.mosip.resident.util.Utility; @@ -85,6 +86,9 @@ public class DownloadMasterdataControllerTest { @MockBean private AuditUtil auditUtil; + + @MockBean + private ResidentServiceImpl residentService; @Mock private Utility utility; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/GrievanceControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/GrievanceControllerTest.java index 20be350734f..ec9fedad1ed 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/GrievanceControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/GrievanceControllerTest.java @@ -12,6 +12,7 @@ import io.mosip.resident.service.GrievanceService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.impl.IdentityServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; import io.mosip.resident.util.Utility; @@ -86,6 +87,9 @@ public class GrievanceControllerTest { @MockBean private ResidentVidService vidService; + + @MockBean + private ResidentServiceImpl residentService; @MockBean private CryptoCoreSpec encryptor; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/IdAuthControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/IdAuthControllerTest.java index 45127be6af6..7fcdbf6bcab 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/IdAuthControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/IdAuthControllerTest.java @@ -32,6 +32,7 @@ import io.mosip.resident.service.ProxyIdRepoService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.impl.IdAuthServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; import reactor.util.function.Tuples; @@ -73,6 +74,9 @@ public class IdAuthControllerTest { @MockBean private ObjectStoreHelper objectStore; + + @MockBean + private ResidentServiceImpl residentService; Gson gson = new GsonBuilder().serializeNulls().create(); diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/IdentityControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/IdentityControllerTest.java index 9f6132a95d6..0155c570036 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/IdentityControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/IdentityControllerTest.java @@ -36,6 +36,7 @@ import io.mosip.resident.service.ProxyIdRepoService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.impl.IdentityServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; @@ -82,6 +83,9 @@ public class IdentityControllerTest { @Autowired private MockMvc mockMvc; + + @MockBean + private ResidentServiceImpl residentService; private ResponseWrapper responseWrapper; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/OrderCardControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/OrderCardControllerTest.java index fdb99304f68..4c5afb423eb 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/OrderCardControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/OrderCardControllerTest.java @@ -44,6 +44,7 @@ import io.mosip.resident.service.ProxyIdRepoService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.impl.IdentityServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; @@ -93,6 +94,9 @@ public class OrderCardControllerTest { @MockBean private CryptoCoreSpec encryptor; + + @MockBean + private ResidentServiceImpl residentService; @Autowired private MockMvc mockMvc; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyAuditControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyAuditControllerTest.java index 27142779b2b..471bcf26557 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyAuditControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyAuditControllerTest.java @@ -39,6 +39,7 @@ import io.mosip.resident.service.IdentityService; import io.mosip.resident.service.ProxyIdRepoService; import io.mosip.resident.service.ResidentVidService; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; import io.mosip.resident.util.Utility; @@ -67,6 +68,9 @@ public class ProxyAuditControllerTest { @Mock private Utility utility; + + @MockBean + private ResidentServiceImpl residentService; @MockBean @Qualifier("selfTokenRestTemplate") diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyConfigControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyConfigControllerTest.java index 5dbbc6f3035..9c7a76b810a 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyConfigControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyConfigControllerTest.java @@ -36,6 +36,7 @@ import io.mosip.resident.service.ProxyIdRepoService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.impl.ResidentConfigServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; @@ -75,6 +76,9 @@ public class ProxyConfigControllerTest { @MockBean private ResidentVidService vidService; + + @MockBean + private ResidentServiceImpl residentService; @MockBean private CryptoCoreSpec encryptor; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyMasterdataControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyMasterdataControllerTest.java index ed2543a60f0..3a39a1b5063 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyMasterdataControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyMasterdataControllerTest.java @@ -9,6 +9,8 @@ import io.mosip.resident.controller.AcknowledgementController; import io.mosip.resident.service.impl.AcknowledgementServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -81,6 +83,9 @@ public class ProxyMasterdataControllerTest { @MockBean private ObjectStoreHelper objectStore; + + @MockBean + private ResidentServiceImpl residentService; @Autowired private MockMvc mockMvc; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyOtpControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyOtpControllerTest.java index 1260870dadf..2ba3c542a9b 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyOtpControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyOtpControllerTest.java @@ -16,6 +16,7 @@ import io.mosip.resident.service.ProxyOtpService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.impl.IdentityServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; import io.mosip.resident.util.Utility; @@ -96,6 +97,9 @@ public class ProxyOtpControllerTest { @MockBean private AuditUtil auditUtil; + + @MockBean + private ResidentServiceImpl residentService; @Mock private Utility utility; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyPartnerManagementControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyPartnerManagementControllerTest.java index bcd208c7538..245a21d019f 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyPartnerManagementControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ProxyPartnerManagementControllerTest.java @@ -33,6 +33,7 @@ import io.mosip.resident.service.ProxyIdRepoService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.impl.ProxyPartnerManagementServiceImpl; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; @@ -73,6 +74,9 @@ public class ProxyPartnerManagementControllerTest { @MockBean private ResidentVidService vidService; + + @MockBean + private ResidentServiceImpl residentService; @Autowired private MockMvc mockMvc; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ResidentOtpControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ResidentOtpControllerTest.java index 6afa319877f..7612354ca7b 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ResidentOtpControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ResidentOtpControllerTest.java @@ -44,6 +44,7 @@ import io.mosip.resident.service.ProxyIdRepoService; import io.mosip.resident.service.ResidentOtpService; import io.mosip.resident.service.ResidentVidService; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; import io.mosip.resident.util.Utilities; @@ -95,6 +96,9 @@ public class ResidentOtpControllerTest { @MockBean @Qualifier("selfTokenRestTemplate") private RestTemplate residentRestTemplate; + + @MockBean + private ResidentServiceImpl residentService; @Mock private AuditUtil audit; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ResidentVerificationControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ResidentVerificationControllerTest.java index d4a926e79ef..02579bbb8bf 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ResidentVerificationControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/ResidentVerificationControllerTest.java @@ -8,6 +8,7 @@ import io.mosip.resident.service.ProxyIdRepoService; import io.mosip.resident.service.ResidentVidService; import io.mosip.resident.service.VerificationService; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.service.impl.VerificationServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; @@ -72,6 +73,9 @@ public class ResidentVerificationControllerTest { @MockBean @Qualifier("selfTokenRestTemplate") private RestTemplate residentRestTemplate; + + @MockBean + private ResidentServiceImpl residentService; @Mock private AuditUtil audit; diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/WebSubUpdateAuthTypeControllerTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/WebSubUpdateAuthTypeControllerTest.java index 7de0e9ca169..fa2d95a270f 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/controller/WebSubUpdateAuthTypeControllerTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/controller/WebSubUpdateAuthTypeControllerTest.java @@ -6,6 +6,7 @@ import io.mosip.resident.controller.WebSubUpdateAuthTypeController; import io.mosip.resident.helper.ObjectStoreHelper; import io.mosip.resident.service.*; +import io.mosip.resident.service.impl.ResidentServiceImpl; import io.mosip.resident.service.impl.VerificationServiceImpl; import io.mosip.resident.test.ResidentTestBootApplication; import io.mosip.resident.util.AuditUtil; @@ -82,6 +83,9 @@ public class WebSubUpdateAuthTypeControllerTest { @InjectMocks VerificationController verificationController; + + @MockBean + private ResidentServiceImpl residentService; @Before public void setup() throws Exception { diff --git a/resident/resident-service/src/test/java/io/mosip/resident/test/service/ResidentServiceDownloadCardTest.java b/resident/resident-service/src/test/java/io/mosip/resident/test/service/ResidentServiceDownloadCardTest.java index cdc31510cd2..2e145ce0267 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/test/service/ResidentServiceDownloadCardTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/test/service/ResidentServiceDownloadCardTest.java @@ -38,6 +38,7 @@ import org.springframework.core.env.Environment; import org.springframework.http.HttpStatus; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.util.ReflectionTestUtils; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -133,6 +134,7 @@ public void setup() throws Exception { Mockito.when(environment.getProperty(Mockito.anyString())).thenReturn(ApiName.DIGITAL_CARD_STATUS_URL.toString()); Mockito.when(residentServiceRestClient.getApi((URI)any(), any(Class.class))).thenReturn(responseDto); Mockito.when(objectStoreHelper.decryptData(Mockito.anyString(), Mockito.anyString(), Mockito.anyString())).thenReturn("ZGF0YQ=="); + ReflectionTestUtils.setField(residentServiceImpl, "asyncRequestTypes", List.of("TEST")); } @Test(expected = ResidentServiceException.class) public void testUpdateMyUinException() throws ResidentServiceCheckedException{