diff --git a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java index aac16c6448..470f714830 100644 --- a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java +++ b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/controllers/PolicyStoreController.java @@ -144,7 +144,7 @@ public CreatePoliciesResponse registerAllowedPolicy(@Valid @RequestBody final Cr description = "Returns the policies as map of BPN to list of policies.", content = { @Content(mediaType = APPLICATION_JSON_VALUE, examples = @ExampleObject( - value = PolicyResponse.BPN_TO_POLICY_MAP_EXAMPLE), + PolicyResponse.BPN_TO_POLICY_MAP_EXAMPLE), schema = @Schema( description = "Map of BPN to list of policies")) }), 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 fcd9fbe288..7b9eb684dc 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 @@ -70,6 +70,19 @@ }) public class PolicyStoreService implements AcceptedPoliciesProvider { + private final List allowedPoliciesFromConfig; + + private final PolicyPersistence persistence; + + private final EdcTransformer edcTransformer; + + private final Clock clock; + + private static final String MISSING_REQUEST_FIELD_MESSAGE = + "Request does not contain all required fields. " + "Missing: %s"; + + private static final String DEFAULT = "default"; + /** * Constants for the configured default policy. */ @@ -85,19 +98,6 @@ private static final class ConfiguredDefaultPolicy { public static final int DEFAULT_POLICY_LIFETIME_YEARS = 5; } - private final List allowedPoliciesFromConfig; - - private final PolicyPersistence persistence; - - private final EdcTransformer edcTransformer; - - private final Clock clock; - - private static final String MISSING_REQUEST_FIELD_MESSAGE = - "Request does not contain all required fields. " + "Missing: %s"; - - static final String DEFAULT = "default"; - public PolicyStoreService(final DefaultAcceptedPoliciesConfig defaultAcceptedPoliciesConfig, final PolicyPersistence persistence, final EdcTransformer edcTransformer, final Clock clock) { this.allowedPoliciesFromConfig = createDefaultPolicyFromConfig(defaultAcceptedPoliciesConfig); diff --git a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/validators/BusinessPartnerNumberListValidator.java b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/validators/BusinessPartnerNumberListValidator.java index ef9a5f4a1d..e143126d07 100644 --- a/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/validators/BusinessPartnerNumberListValidator.java +++ b/irs-policy-store/src/main/java/org/eclipse/tractusx/irs/policystore/validators/BusinessPartnerNumberListValidator.java @@ -39,7 +39,7 @@ public class BusinessPartnerNumberListValidator private static final Pattern PATTERN = Pattern.compile(BPN_REGEX); @Override - public boolean isValid(List value, ConstraintValidatorContext context) { + public boolean isValid(final List value, final ConstraintValidatorContext context) { // allow null and empty here (in order to allow flexible combination with @NotNull and @NotEmpty) if (value == null || value.isEmpty()) { diff --git a/irs-policy-store/src/test/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreServiceTest.java b/irs-policy-store/src/test/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreServiceTest.java index 40bbcf386e..7508a276b9 100644 --- a/irs-policy-store/src/test/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreServiceTest.java +++ b/irs-policy-store/src/test/java/org/eclipse/tractusx/irs/policystore/services/PolicyStoreServiceTest.java @@ -317,7 +317,7 @@ void getAcceptedPolicies_whenNoPoliciesAssociatedWithTheGivenBpn_shouldReturnThe // this overrides the configured default policy (see the previous test above) final String defaultPolicyId1 = "registered-default-policy-1"; final String defaultPolicyId2 = "registered-default-policy-2"; - when(persistenceMock.readAll(PolicyStoreService.DEFAULT)).thenReturn(List.of( + when(persistenceMock.readAll("default")).thenReturn(List.of( // default policy 1 createPolicy(defaultPolicyId1), // default policy 2