Skip to content

Commit

Permalink
Merge pull request #825 from dsmf/chore/734-cleanup
Browse files Browse the repository at this point in the history
Chore/734 cleanup
ds-jhartmann authored Jul 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 99c0296 + f9b3883 commit ff05add
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -181,13 +181,13 @@ public List<AcceptedPolicy> getConfiguredDefaultPolicies() {

public Map<String, List<Policy>> getAllStoredPolicies() {
final Map<String, List<Policy>> bpnToPolicies = persistence.readAll();
if (containsNoDefaultPolicyAvailable(bpnToPolicies)) {
bpnToPolicies.put("default", allowedPoliciesFromConfig);
if (containsNoDefaultPolicy(bpnToPolicies)) {
bpnToPolicies.put(DEFAULT, allowedPoliciesFromConfig);
}
return bpnToPolicies;
}

private static boolean containsNoDefaultPolicyAvailable(final Map<String, List<Policy>> bpnToPolicies) {
private static boolean containsNoDefaultPolicy(final Map<String, List<Policy>> bpnToPolicies) {
return bpnToPolicies.keySet().stream().noneMatch(key -> StringUtils.isEmpty(key) || DEFAULT.equals(key));
}

0 comments on commit ff05add

Please sign in to comment.