Skip to content

Commit

Permalink
Fixed Test cases error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mahammedtaheer committed Sep 15, 2023
1 parent 384b193 commit 5f9a0bd
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.context.WebApplicationContext;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.mosip.authentication.common.service.entity.AutnTxn;
Expand Down Expand Up @@ -91,13 +89,16 @@ public void before() {

@Test
public void createAnonymousProfileWith_YourOfBirthTest() throws IdAuthenticationBusinessException {
requestBody = new HashMap<>();
requestMetadata = new HashMap<>();
List<IdentityInfoDTO> dobList = new ArrayList<IdentityInfoDTO>();
IdentityInfoDTO dob = new IdentityInfoDTO();
dob.setLanguage("Eng");
dob.setValue("1993/04/11");
dobList.add(dob);
idInfoMap.put("dateOfBirth", dobList);
responseMetadata.put("IDENTITY_INFO", idInfoMap );


Map<String, Object> authResponse = new HashMap<>();
authResponse.put("authStatus", "true");
Expand All @@ -111,6 +112,8 @@ public void createAnonymousProfileWith_YourOfBirthTest() throws IdAuthentication

@Test
public void createAnonymousProfileWith_PreferredLangTest() throws IdAuthenticationBusinessException {
requestBody = new HashMap<>();
requestMetadata = new HashMap<>();
List<IdentityInfoDTO> preferedLangList = new ArrayList<IdentityInfoDTO>();
IdentityInfoDTO lang = new IdentityInfoDTO();
lang.setLanguage("eng");
Expand All @@ -131,6 +134,8 @@ public void createAnonymousProfileWith_PreferredLangTest() throws IdAuthenticati

@Test
public void createAnonymousProfileWith_GenderTest() throws IdAuthenticationBusinessException {
requestBody = new HashMap<>();
requestMetadata = new HashMap<>();
List<IdentityInfoDTO> genderList = new ArrayList<IdentityInfoDTO>();
IdentityInfoDTO gender = new IdentityInfoDTO();
gender.setLanguage("eng");
Expand All @@ -151,6 +156,8 @@ public void createAnonymousProfileWith_GenderTest() throws IdAuthenticationBusin

@Test
public void createAnonymousProfileWith_LocationTest() throws IdAuthenticationBusinessException {
requestBody = new HashMap<>();
requestMetadata = new HashMap<>();
List<IdentityInfoDTO> preferedLangList = new ArrayList<IdentityInfoDTO>();
IdentityInfoDTO lang = new IdentityInfoDTO();
lang.setLanguage(null);
Expand All @@ -176,6 +183,8 @@ public void createAnonymousProfileWith_LocationTest() throws IdAuthenticationBus

@Test
public void createAnonymousProfileWith_BiometricInfoTest() throws IdAuthenticationBusinessException, IOException {
requestBody = new HashMap<>();
requestMetadata = new HashMap<>();
List<IdentityInfoDTO> preferedLangList = new ArrayList<IdentityInfoDTO>();
IdentityInfoDTO lang = new IdentityInfoDTO();
lang.setLanguage("eng");
Expand Down Expand Up @@ -214,6 +223,8 @@ public void createAnonymousProfileWith_BiometricInfoTest() throws IdAuthenticati

@Test
public void createAnonymousProfileWith_AuthFactorsTest() throws IdAuthenticationBusinessException {
requestBody = new HashMap<>();
requestMetadata = new HashMap<>();
AutnTxn authTxn = new AutnTxn();
authTxn.setAuthTypeCode("OTP-REQUEST,DEMO-AUTH,BIO-AUTH");
responseMetadata.put("AutnTxn",authTxn);
Expand All @@ -231,6 +242,8 @@ public void createAnonymousProfileWith_AuthFactorsTest() throws IdAuthentication

@Test
public void createAnonymousProfileWith_PartnerTest() throws IdAuthenticationBusinessException {
requestBody = new HashMap<>();
requestMetadata = new HashMap<>();
PartnerDTO partner = new PartnerDTO();
partner.setPartnerName("SyncByte");
partner.setPartnerId("abc");
Expand All @@ -243,6 +256,8 @@ public void createAnonymousProfileWith_PartnerTest() throws IdAuthenticationBusi

@Test
public void createAnonymousProfileExceptionTest() throws IdAuthenticationBusinessException {
requestBody = new HashMap<>();
requestMetadata = new HashMap<>();
Map<String, Object> authResponse = new HashMap<>();
authResponse.put("authStatus", "false");
authResponse.put("authToken", "");
Expand Down

0 comments on commit 5f9a0bd

Please sign in to comment.