From 94b59775f85088369a25e8e572cd6e8c8c167f33 Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 13 May 2024 12:30:45 +0200 Subject: [PATCH] feat(impl): [#528] extract constraints to constants --- .../policystore/services/PolicyStoreServiceTest.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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 c3f4cfcb12..1b696109c7 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 @@ -48,10 +48,8 @@ import org.eclipse.edc.jsonld.TitaniumJsonLd; import org.eclipse.edc.spi.monitor.ConsoleMonitor; import org.eclipse.tractusx.irs.edc.client.policy.AcceptedPolicy; -import org.eclipse.tractusx.irs.edc.client.policy.Constraint; +import org.eclipse.tractusx.irs.edc.client.policy.ConstraintConstants; import org.eclipse.tractusx.irs.edc.client.policy.Constraints; -import org.eclipse.tractusx.irs.edc.client.policy.Operator; -import org.eclipse.tractusx.irs.edc.client.policy.OperatorType; import org.eclipse.tractusx.irs.edc.client.policy.Permission; import org.eclipse.tractusx.irs.edc.client.policy.Policy; import org.eclipse.tractusx.irs.edc.client.policy.PolicyType; @@ -369,10 +367,8 @@ private List createPermissions() { } private Constraints createConstraints() { - return new Constraints(Collections.emptyList(), - List.of(new Constraint("Membership", new Operator(OperatorType.EQ), "active"), - new Constraint("FrameworkAgreement.traceability", new Operator(OperatorType.EQ), "active"), - new Constraint(EXAMPLE_ACCEPTED_LEFT_OPERAND, new Operator(OperatorType.EQ), "ID 3.1 Trace"))); + return new Constraints(Collections.emptyList(), List.of(ConstraintConstants.ACTIVE_MEMBERSHIP, + ConstraintConstants.FRAMEWORK_AGREEMENT_TRACEABILITY_ACTIVE, ConstraintConstants.PURPOSE_ID_3_1_TRACE)); } @Nested