Skip to content

Commit

Permalink
chore(cleanup): [eclipse-tractusx#734] use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmf committed Jul 17, 2024
1 parent b264560 commit f9b3883
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
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));
}

Expand Down

0 comments on commit f9b3883

Please sign in to comment.