Skip to content

Commit

Permalink
reviewed comments
Browse files Browse the repository at this point in the history
Signed-off-by: Venkata Saidurga Polamraju <[email protected]>
  • Loading branch information
pvsaidurga committed Sep 5, 2024
1 parent 533155e commit dbb543d
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ public void authChallengeFactorFormatValidator_invalidFactoFormat_thenFail() {
public void authChallengeFactorFormatValidator_withKBIAuthFactor_thenPass() {
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"objectMapper",new ObjectMapper());
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"idField","individualId");
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","")
,Map.of("id","fullName","type","","format","","regex","")
, Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd","regex",""));
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","^\\d+$")
,Map.of("id","fullName","type","","format","","regex","^[\\p{L} .'-]+$")
, Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd","regex","^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$"));
ReflectionTestUtils.setField(authChallengeFactorFormatValidator, "fieldDetailList", fieldDetailList);
AuthChallenge authChallenge = new AuthChallenge();
authChallenge.setAuthFactorType("KBI");
Expand All @@ -147,9 +147,9 @@ public void authChallengeFactorFormatValidator_withKBIAuthFactor_thenPass() {
public void authChallengeFactorFormatValidator_withInvalidKBIChallenge_thenFail() {
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"objectMapper",new ObjectMapper());
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"idField","individualId");
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","")
,Map.of("id","fullName","type","","format","","regex","")
, Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd","regex",""));
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","^\\d+$")
,Map.of("id","fullName","type","","format","","regex","^[\\p{L} .'-]+$")
, Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd","regex","^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$"));
ReflectionTestUtils.setField(authChallengeFactorFormatValidator, "fieldDetailList", fieldDetailList);
AuthChallenge authChallenge = new AuthChallenge();
authChallenge.setAuthFactorType("KBI");
Expand All @@ -166,9 +166,9 @@ public void authChallengeFactorFormatValidator_withInvalidKBIChallenge_thenFail(
public void authChallengeFactorFormatValidator_withKBIInvalidRegex_thenFail() {
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"objectMapper",new ObjectMapper());
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"idField","individualId");
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","")
,Map.of("id","fullName","type","text","format","","regex","")
, Map.of("id","dob","type","text","format","yyyy-MM-dd","regex",""));
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","^\\d+$")
,Map.of("id","fullName","type","text","format","","regex","^\\d+$")
, Map.of("id","dob","type","text","format","yyyy-MM-dd","regex","^\\d+$"));
ReflectionTestUtils.setField(authChallengeFactorFormatValidator, "fieldDetailList", fieldDetailList);
AuthChallenge authChallenge = new AuthChallenge();
authChallenge.setAuthFactorType("KBI");
Expand All @@ -185,9 +185,9 @@ public void authChallengeFactorFormatValidator_withKBIInvalidRegex_thenFail() {
public void authChallengeFactorFormatValidator_withEmptyName_thenFail() {
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"objectMapper",new ObjectMapper());
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"idField","individualId");
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","")
,Map.of("id","fullName","type","text","format","","regex","")
, Map.of("id","dob","type","text","format","yyyy-MM-dd","regex",""));
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","^\\d+$")
,Map.of("id","fullName","type","text","format","","regex","^[\\p{L} .'-]+$")
, Map.of("id","dob","type","text","format","yyyy-MM-dd","regex","^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$"));
ReflectionTestUtils.setField(authChallengeFactorFormatValidator, "fieldDetailList", fieldDetailList);
AuthChallenge authChallenge = new AuthChallenge();
authChallenge.setAuthFactorType("KBI");
Expand All @@ -204,9 +204,9 @@ public void authChallengeFactorFormatValidator_withEmptyName_thenFail() {
public void authChallengeFactorFormatValidator_withMaximumLength_thenFail1() {
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"objectMapper",new ObjectMapper());
ReflectionTestUtils.setField(authChallengeFactorFormatValidator,"idField","individualId");
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","")
,Map.of("id","fullName","type","text","format","","regex","","maxLength","10")
, Map.of("id","dob","type","text","format","yyyy-MM-dd","regex",""));
List<Map<String,String>> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string","regex","^\\d+$")
,Map.of("id","fullName","type","text","format","","regex","^[\\p{L} .'-]+$","maxLength","10")
, Map.of("id","dob","type","text","format","yyyy-MM-dd","regex","^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$"));
ReflectionTestUtils.setField(authChallengeFactorFormatValidator, "fieldDetailList", fieldDetailList);
AuthChallenge authChallenge = new AuthChallenge();
authChallenge.setAuthFactorType("KBI");
Expand Down

0 comments on commit dbb543d

Please sign in to comment.