From b264560601be0af71c68897757c1d2087318d570 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 17 Jul 2024 13:55:17 +0200 Subject: [PATCH 1/2] chore(cleanup): [#734] use constant --- .../tractusx/irs/policystore/services/PolicyStoreService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java index d7dbe61d1..203bbb777 100644 --- a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java +++ b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java @@ -182,7 +182,7 @@ public List getConfiguredDefaultPolicies() { public Map> getAllStoredPolicies() { final Map> bpnToPolicies = persistence.readAll(); if (containsNoDefaultPolicyAvailable(bpnToPolicies)) { - bpnToPolicies.put("default", allowedPoliciesFromConfig); + bpnToPolicies.put(DEFAULT, allowedPoliciesFromConfig); } return bpnToPolicies; } From f9b3883ef6b114a905f2216dc827cc52ff405024 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Wed, 17 Jul 2024 13:15:32 +0200 Subject: [PATCH 2/2] chore(cleanup): [#734] use constant --- .../tractusx/irs/policystore/services/PolicyStoreService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java index 203bbb777..776623dd5 100644 --- a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java +++ b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreService.java @@ -181,13 +181,13 @@ public List getConfiguredDefaultPolicies() { public Map> getAllStoredPolicies() { final Map> bpnToPolicies = persistence.readAll(); - if (containsNoDefaultPolicyAvailable(bpnToPolicies)) { + if (containsNoDefaultPolicy(bpnToPolicies)) { bpnToPolicies.put(DEFAULT, allowedPoliciesFromConfig); } return bpnToPolicies; } - private static boolean containsNoDefaultPolicyAvailable(final Map> bpnToPolicies) { + private static boolean containsNoDefaultPolicy(final Map> bpnToPolicies) { return bpnToPolicies.keySet().stream().noneMatch(key -> StringUtils.isEmpty(key) || DEFAULT.equals(key)); }