Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notification api issues 1 #709

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -73,6 +74,9 @@ public class AuthTransactionCallbackControllerTest {

@MockBean
private ObjectStoreHelper objectStore;

@MockBean
private ResidentServiceImpl residentService;

@MockBean
private VerificationServiceImpl verificationServiceImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -93,6 +94,9 @@ public class DownloadCardControllerTest {

@MockBean
private ResidentVidService vidService;

@MockBean
private ResidentServiceImpl residentService;

@MockBean
private CryptoCoreSpec<byte[], byte[], SecretKey, PublicKey, PrivateKey, String> encryptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -85,6 +86,9 @@ public class DownloadMasterdataControllerTest {

@MockBean
private AuditUtil auditUtil;

@MockBean
private ResidentServiceImpl residentService;

@Mock
private Utility utility;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -86,6 +87,9 @@ public class GrievanceControllerTest {

@MockBean
private ResidentVidService vidService;

@MockBean
private ResidentServiceImpl residentService;

@MockBean
private CryptoCoreSpec<byte[], byte[], SecretKey, PublicKey, PrivateKey, String> encryptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -73,6 +74,9 @@ public class IdAuthControllerTest {

@MockBean
private ObjectStoreHelper objectStore;

@MockBean
private ResidentServiceImpl residentService;

Gson gson = new GsonBuilder().serializeNulls().create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -82,6 +83,9 @@ public class IdentityControllerTest {

@Autowired
private MockMvc mockMvc;

@MockBean
private ResidentServiceImpl residentService;

private ResponseWrapper responseWrapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -93,6 +94,9 @@ public class OrderCardControllerTest {

@MockBean
private CryptoCoreSpec<byte[], byte[], SecretKey, PublicKey, PrivateKey, String> encryptor;

@MockBean
private ResidentServiceImpl residentService;

@Autowired
private MockMvc mockMvc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -67,6 +68,9 @@ public class ProxyAuditControllerTest {

@Mock
private Utility utility;

@MockBean
private ResidentServiceImpl residentService;

@MockBean
@Qualifier("selfTokenRestTemplate")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -75,6 +76,9 @@ public class ProxyConfigControllerTest {

@MockBean
private ResidentVidService vidService;

@MockBean
private ResidentServiceImpl residentService;

@MockBean
private CryptoCoreSpec<byte[], byte[], SecretKey, PublicKey, PrivateKey, String> encryptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -81,6 +83,9 @@ public class ProxyMasterdataControllerTest {

@MockBean
private ObjectStoreHelper objectStore;

@MockBean
private ResidentServiceImpl residentService;

@Autowired
private MockMvc mockMvc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -96,6 +97,9 @@ public class ProxyOtpControllerTest {

@MockBean
private AuditUtil auditUtil;

@MockBean
private ResidentServiceImpl residentService;

@Mock
private Utility utility;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -73,6 +74,9 @@ public class ProxyPartnerManagementControllerTest {

@MockBean
private ResidentVidService vidService;

@MockBean
private ResidentServiceImpl residentService;

@Autowired
private MockMvc mockMvc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -95,6 +96,9 @@ public class ResidentOtpControllerTest {
@MockBean
@Qualifier("selfTokenRestTemplate")
private RestTemplate residentRestTemplate;

@MockBean
private ResidentServiceImpl residentService;

@Mock
private AuditUtil audit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,6 +73,9 @@ public class ResidentVerificationControllerTest {
@MockBean
@Qualifier("selfTokenRestTemplate")
private RestTemplate residentRestTemplate;

@MockBean
private ResidentServiceImpl residentService;

@Mock
private AuditUtil audit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -82,6 +83,9 @@ public class WebSubUpdateAuthTypeControllerTest {

@InjectMocks
VerificationController verificationController;

@MockBean
private ResidentServiceImpl residentService;

@Before
public void setup() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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{
Expand Down