Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Oct 20, 2023
1 parent 6806926 commit 6a4a7c5
Showing 1 changed file with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,31 @@ public MfaConfig(@Nullable String[] firstFactors, @Nullable String[] defaultRequ
this.defaultRequiredFactorIds = defaultRequiredFactorIds;
}

@Override
public boolean equals(Object other) {
if (other == null) {
private boolean compareStrArray(String[] arr1, String[] arr2) {
if (arr1 == null && arr2 == null) {
return true;
}

if (arr1 == null || arr2 == null) {
return false;
}

if (other instanceof MfaConfig) {
Set<String> thisFirstFactors = Set.of(this.firstFactors);
Set<String> otherFirstFactors = Set.of(((MfaConfig) other).firstFactors);
Set<String> set1 = Set.of(arr1);
Set<String> set2 = Set.of(arr2);

Set<String> thisdefaultRequiredFactorIds = Set.of(this.defaultRequiredFactorIds);
Set<String> otherdefaultRequiredFactorIds = Set.of(((MfaConfig) other).defaultRequiredFactorIds);
return set1.equals(set2);
}

return thisFirstFactors.equals(otherFirstFactors) &&
thisdefaultRequiredFactorIds.equals(otherdefaultRequiredFactorIds);
@Override
public boolean equals(Object other) {
if (other == null) {
return false;
}
if (!(other instanceof MfaConfig)) {
return false;
}

return false;
return compareStrArray(this.firstFactors, ((MfaConfig) other).firstFactors) &&
compareStrArray(this.defaultRequiredFactorIds, ((MfaConfig) other).defaultRequiredFactorIds);
}
}

0 comments on commit 6a4a7c5

Please sign in to comment.