diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java b/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java index 59438e5ec69..659ae780b03 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java +++ b/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/policy/ContractExpiryCheckFunctionEvaluationTest.java @@ -66,7 +66,7 @@ class ContractExpiryCheckFunctionEvaluationTest { @BeforeEach void setup() { // bind/register rule to evaluate contract expiry - bindingRegistry.bind("USE", TRANSFER_SCOPE); + bindingRegistry.bind("use", TRANSFER_SCOPE); bindingRegistry.bind(CONTRACT_EXPIRY_EVALUATION_KEY, TRANSFER_SCOPE); policyEngine = new PolicyEngineImpl(new ScopeFilter(bindingRegistry)); policyEngine.registerFunction(TRANSFER_SCOPE, Permission.class, CONTRACT_EXPIRY_EVALUATION_KEY, function); @@ -152,7 +152,7 @@ private Policy createInForcePolicy(Operator operatorStart, Object startDate, Ope .build()) .build(); var permission = Permission.Builder.newInstance() - .action(Action.Builder.newInstance().type("USE").build()) + .action(Action.Builder.newInstance().type("use").build()) .constraint(fixedInForceTimeConstraint).build(); return Policy.Builder.newInstance() diff --git a/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplScenariosTest.java b/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplScenariosTest.java index 7a52c54c523..5907a84dab9 100644 --- a/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplScenariosTest.java +++ b/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplScenariosTest.java @@ -42,7 +42,7 @@ public class PolicyEngineImplScenariosTest { private static final String TEST_SCOPE = "test"; private static final String ABS_SPATIAL_CONSTRAINT = "absoluteSpatialPosition"; private static final String CONNECTOR_CONSTRAINT = "connector"; - private static final Action USE_ACTION = Action.Builder.newInstance().type("USE").build(); + private static final Action USE_ACTION = Action.Builder.newInstance().type("use").build(); private final RuleBindingRegistry bindingRegistry = new RuleBindingRegistryImpl(); private PolicyEngineImpl policyEngine; diff --git a/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplTest.java b/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplTest.java index 47961849f9c..5a337f697b3 100644 --- a/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplTest.java +++ b/core/common/policy-engine/src/test/java/org/eclipse/edc/policy/engine/PolicyEngineImplTest.java @@ -199,7 +199,7 @@ void validateScopeIsInheritedByChildren() { void validateRuleFunctionOutOfScope() { bindingRegistry.bind("foo", ALL_SCOPES); - var action = Action.Builder.newInstance().type("USE").build(); + var action = Action.Builder.newInstance().type("use").build(); var permission = Permission.Builder.newInstance().action(action).build(); diff --git a/core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorTest.java b/core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorTest.java index d9d5ed6701c..f046482a600 100644 --- a/core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorTest.java +++ b/core/common/policy-evaluator/src/test/java/org/eclipse/edc/policy/evaluator/PolicyEvaluatorTest.java @@ -191,7 +191,7 @@ void verifyDynamicProhibitionFunctionsHierarchy() { @Test void verifyPermissionRuleFunctions() { - var permission = Permission.Builder.newInstance().action(Action.Builder.newInstance().type("USE").build()).build(); + var permission = Permission.Builder.newInstance().action(Action.Builder.newInstance().type("use").build()).build(); var policy = Policy.Builder.newInstance().permission(permission).build(); var evaluator = PolicyEvaluator.Builder.newInstance().permissionRuleFunction((p) -> true).build(); diff --git a/core/common/transform-core/src/test/java/org/eclipse/edc/core/transform/transformer/from/JsonObjectFromPolicyTransformerTest.java b/core/common/transform-core/src/test/java/org/eclipse/edc/core/transform/transformer/from/JsonObjectFromPolicyTransformerTest.java index 90bb06f0d5c..1d455da71b2 100644 --- a/core/common/transform-core/src/test/java/org/eclipse/edc/core/transform/transformer/from/JsonObjectFromPolicyTransformerTest.java +++ b/core/common/transform-core/src/test/java/org/eclipse/edc/core/transform/transformer/from/JsonObjectFromPolicyTransformerTest.java @@ -91,7 +91,7 @@ void setUp() { @Test void transform_policyWithAllRuleTypes_returnJsonObject() { - var action = Action.Builder.newInstance().type("USE").build(); + var action = Action.Builder.newInstance().type("use").build(); var permission = Permission.Builder.newInstance().action(action).build(); var prohibition = Prohibition.Builder.newInstance().action(action).build(); var duty = Duty.Builder.newInstance().action(action).build(); @@ -147,7 +147,7 @@ void transform_policyWithAllRuleTypes_returnJsonObject() { void transform_actionWithAllAttributes_returnJsonObject() { var constraint = getConstraint(); var action = Action.Builder.newInstance() - .type("USE") + .type("use") .includedIn("includedIn") .constraint(constraint) .build(); @@ -357,7 +357,7 @@ public Stream provideArguments(ExtensionContext extensionCo } private Action getAction() { - return Action.Builder.newInstance().type("USE").build(); + return Action.Builder.newInstance().type("use").build(); } private AtomicConstraint getConstraint() { diff --git a/core/common/transform-core/src/test/java/org/eclipse/edc/core/transform/transformer/to/JsonObjectToActionTransformerTest.java b/core/common/transform-core/src/test/java/org/eclipse/edc/core/transform/transformer/to/JsonObjectToActionTransformerTest.java index 06d4e60c957..e5c7961e0c6 100644 --- a/core/common/transform-core/src/test/java/org/eclipse/edc/core/transform/transformer/to/JsonObjectToActionTransformerTest.java +++ b/core/common/transform-core/src/test/java/org/eclipse/edc/core/transform/transformer/to/JsonObjectToActionTransformerTest.java @@ -59,12 +59,12 @@ void setUp() { @Test void transform_onlyActionType_returnAction() { - var action = jsonFactory.createObjectBuilder().add(ODRL_ACTION_TYPE_ATTRIBUTE, "USE").build(); + var action = jsonFactory.createObjectBuilder().add(ODRL_ACTION_TYPE_ATTRIBUTE, "use").build(); var result = transformer.transform(getExpanded(action), context); assertThat(result).isNotNull(); - assertThat(result.getType()).isEqualTo("USE"); + assertThat(result.getType()).isEqualTo("use"); assertThat(result.getIncludedIn()).isNull(); assertThat(result.getConstraint()).isNull(); @@ -73,14 +73,14 @@ void transform_onlyActionType_returnAction() { @Test void transform_onlyActionAttribute_returnAction() { - var actionContainer = jsonFactory.createObjectBuilder().add(ODRL_ACTION_ATTRIBUTE, "USE").build(); + var actionContainer = jsonFactory.createObjectBuilder().add(ODRL_ACTION_ATTRIBUTE, "use").build(); var expanded = getExpanded(actionContainer); var action = expanded.getJsonArray(ODRL_ACTION_ATTRIBUTE).get(0).asJsonObject(); var result = transformer.transform(action, context); assertThat(result).isNotNull(); - assertThat(result.getType()).isEqualTo("USE"); + assertThat(result.getType()).isEqualTo("use"); assertThat(result.getIncludedIn()).isNull(); assertThat(result.getConstraint()).isNull(); @@ -114,7 +114,7 @@ void transform_allAttributes_returnAction() { when(context.transform(any(JsonObject.class), eq(Constraint.class))).thenReturn(constraint); var action = jsonFactory.createObjectBuilder() - .add(ODRL_ACTION_TYPE_ATTRIBUTE, "USE") + .add(ODRL_ACTION_TYPE_ATTRIBUTE, "use") .add(ODRL_INCLUDED_IN_ATTRIBUTE, "includedIn") .add(ODRL_REFINEMENT_ATTRIBUTE, jsonFactory.createObjectBuilder().build()) .build(); @@ -122,7 +122,7 @@ void transform_allAttributes_returnAction() { var result = transformer.transform(getExpanded(action), context); assertThat(result).isNotNull(); - assertThat(result.getType()).isEqualTo("USE"); + assertThat(result.getType()).isEqualTo("use"); assertThat(result.getIncludedIn()).isEqualTo("includedIn"); assertThat(result.getConstraint()).isEqualTo(constraint); diff --git a/core/control-plane/contract-core/build.gradle.kts b/core/control-plane/contract-core/build.gradle.kts index 20700df87ed..5d89a920ddd 100644 --- a/core/control-plane/contract-core/build.gradle.kts +++ b/core/control-plane/contract-core/build.gradle.kts @@ -18,6 +18,7 @@ plugins { } dependencies { + api(project(":spi:common:json-ld-spi")) api(project(":spi:common:policy-engine-spi")) api(project(":spi:control-plane:contract-spi")) diff --git a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/ContractCoreExtension.java b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/ContractCoreExtension.java index 84568ca0d92..9016e9ad1e9 100644 --- a/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/ContractCoreExtension.java +++ b/core/control-plane/contract-core/src/main/java/org/eclipse/edc/connector/contract/ContractCoreExtension.java @@ -62,7 +62,7 @@ import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_SEND_RETRY_BASE_DELAY; import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_SEND_RETRY_LIMIT; import static org.eclipse.edc.connector.core.policy.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; -import static org.eclipse.edc.policy.model.OdrlNamespace.ODRL_SCHEMA; +import static org.eclipse.edc.jsonld.spi.PropertyAndTypeNames.ODRL_USE_ACTION_ATTRIBUTE; @Provides({ ContractValidationService.class, ConsumerContractNegotiationManager.class, @@ -180,8 +180,7 @@ private void registerServices(ServiceExtensionContext context) { context.registerService(ContractValidationService.class, validationService); // bind/register rule to evaluate contract expiry - ruleBindingRegistry.bind("USE", TRANSFER_SCOPE); - ruleBindingRegistry.bind(ODRL_SCHEMA + "use", TRANSFER_SCOPE); + ruleBindingRegistry.bind(ODRL_USE_ACTION_ATTRIBUTE, TRANSFER_SCOPE); ruleBindingRegistry.bind(CONTRACT_EXPIRY_EVALUATION_KEY, TRANSFER_SCOPE); var function = new ContractExpiryCheckFunction(); policyEngine.registerFunction(TRANSFER_SCOPE, Permission.class, CONTRACT_EXPIRY_EVALUATION_KEY, function); diff --git a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ContractNegotiationIntegrationTest.java b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ContractNegotiationIntegrationTest.java index c931363c678..0a7db4ee946 100644 --- a/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ContractNegotiationIntegrationTest.java +++ b/core/control-plane/contract-core/src/test/java/org/eclipse/edc/connector/contract/negotiation/ContractNegotiationIntegrationTest.java @@ -381,7 +381,7 @@ private ContractOffer getContractOffer() { .assigner("assigner") .assignee("assignee") .duty(Duty.Builder.newInstance() - .action(Action.Builder.newInstance().type("USE").build()) + .action(Action.Builder.newInstance().type("use").build()) .build()) .build()) .build(); diff --git a/core/policy-monitor/policy-monitor-core/build.gradle.kts b/core/policy-monitor/policy-monitor-core/build.gradle.kts index 04e6c0d7022..57fca2fcffd 100644 --- a/core/policy-monitor/policy-monitor-core/build.gradle.kts +++ b/core/policy-monitor/policy-monitor-core/build.gradle.kts @@ -18,6 +18,7 @@ plugins { dependencies { api(project(":spi:policy-monitor:policy-monitor-spi")) + api(project(":spi:common:json-ld-spi")) api(project(":spi:control-plane:control-plane-spi")) api(project(":spi:control-plane:policy-spi")) api(project(":spi:control-plane:transfer-spi")) diff --git a/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtension.java b/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtension.java index 1ccf32fc850..6f1b5569cfb 100644 --- a/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtension.java +++ b/core/policy-monitor/policy-monitor-core/src/main/java/org/eclipse/edc/connector/policy/monitor/PolicyMonitorExtension.java @@ -43,7 +43,7 @@ import static org.eclipse.edc.connector.core.entity.AbstractStateEntityManager.DEFAULT_ITERATION_WAIT; import static org.eclipse.edc.connector.core.policy.ContractExpiryCheckFunction.CONTRACT_EXPIRY_EVALUATION_KEY; import static org.eclipse.edc.connector.policy.monitor.PolicyMonitorExtension.NAME; -import static org.eclipse.edc.policy.model.OdrlNamespace.ODRL_SCHEMA; +import static org.eclipse.edc.jsonld.spi.PropertyAndTypeNames.ODRL_USE_ACTION_ATTRIBUTE; @Extension(value = NAME) @Provides({ PolicyMonitorManager.class }) @@ -94,7 +94,7 @@ public void initialize(ServiceExtensionContext context) { var iterationWaitMillis = context.getSetting(POLICY_MONITOR_ITERATION_WAIT_MILLIS, DEFAULT_ITERATION_WAIT); var waitStrategy = new ExponentialWaitStrategy(iterationWaitMillis); - ruleBindingRegistry.bind(ODRL_SCHEMA + "use", POLICY_MONITOR_SCOPE); + ruleBindingRegistry.bind(ODRL_USE_ACTION_ATTRIBUTE, POLICY_MONITOR_SCOPE); ruleBindingRegistry.bind(CONTRACT_EXPIRY_EVALUATION_KEY, POLICY_MONITOR_SCOPE); policyEngine.registerFunction(POLICY_MONITOR_SCOPE, Permission.class, CONTRACT_EXPIRY_EVALUATION_KEY, new ContractExpiryCheckFunction()); diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractAgreementMessageTransformerTest.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractAgreementMessageTransformerTest.java index 10f85284fd7..6a6ca6dcebf 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractAgreementMessageTransformerTest.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/from/JsonObjectFromContractAgreementMessageTransformerTest.java @@ -134,7 +134,7 @@ private ContractAgreement contractAgreement() { } private Policy policy() { - var action = Action.Builder.newInstance().type("USE").build(); + var action = Action.Builder.newInstance().type("use").build(); var permission = Permission.Builder.newInstance().action(action).build(); var prohibition = Prohibition.Builder.newInstance().action(action).build(); var duty = Duty.Builder.newInstance().action(action).build(); diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformerTest.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformerTest.java index d723524b064..c47f7667020 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformerTest.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractAgreementMessageTransformerTest.java @@ -216,7 +216,7 @@ private JsonObject contractAgreement() { } private Policy policy() { - var action = Action.Builder.newInstance().type("USE").build(); + var action = Action.Builder.newInstance().type("use").build(); var permission = Permission.Builder.newInstance().action(action).build(); var prohibition = Prohibition.Builder.newInstance().action(action).build(); var duty = Duty.Builder.newInstance().action(action).build(); diff --git a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractRequestMessageTransformerTest.java b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractRequestMessageTransformerTest.java index c593236e1e1..8dce71e97a4 100644 --- a/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractRequestMessageTransformerTest.java +++ b/data-protocols/dsp/dsp-negotiation/dsp-negotiation-transform/src/test/java/org/eclipse/edc/protocol/dsp/negotiation/transform/to/JsonObjectToContractRequestMessageTransformerTest.java @@ -191,7 +191,7 @@ private JsonObject contractOffer() { } private Policy policy() { - var action = Action.Builder.newInstance().type("USE").build(); + var action = Action.Builder.newInstance().type("use").build(); var permission = Permission.Builder.newInstance().action(action).build(); var prohibition = Prohibition.Builder.newInstance().action(action).build(); var duty = Duty.Builder.newInstance().action(action).build(); diff --git a/docs/developer/policy-engine.md b/docs/developer/policy-engine.md index 88812403aa4..b03d983ed12 100644 --- a/docs/developer/policy-engine.md +++ b/docs/developer/policy-engine.md @@ -37,7 +37,7 @@ As an example, we create the module `:extensions:policy:ids-policy`. ### Step 2: Implement a `ServiceExtension` The new policy extension will provide a service extension class and two constraint functions. In -`IdsPolicyExtension`, first, the scope `ALL_SCOPES` is bound to the rule type `USE`. Next, both policy +`IdsPolicyExtension`, first, the scope `ALL_SCOPES` is bound to the rule type `use`. Next, both policy functions are registered to the policy engine. ```java @@ -59,7 +59,7 @@ public class IdsPolicyExtension implements ServiceExtension { @Override public void initialize(ServiceExtensionContext context) { - ruleBindingRegistry.bind(USE, ALL_SCOPES); + ruleBindingRegistry.bind("use", ALL_SCOPES); policyEngine.registerFunction(ALL_SCOPES, Permission.class, ABS_SPATIAL_POSITION, new AbsSpatialPositionConstraintFunction()); policyEngine.registerFunction(ALL_SCOPES, Permission.class, PARTNER_LEVEL, new PartnerLevelConstraintFunction()); diff --git a/spi/common/json-ld-spi/src/main/java/org/eclipse/edc/jsonld/spi/PropertyAndTypeNames.java b/spi/common/json-ld-spi/src/main/java/org/eclipse/edc/jsonld/spi/PropertyAndTypeNames.java index 37081efce59..b46de515c56 100644 --- a/spi/common/json-ld-spi/src/main/java/org/eclipse/edc/jsonld/spi/PropertyAndTypeNames.java +++ b/spi/common/json-ld-spi/src/main/java/org/eclipse/edc/jsonld/spi/PropertyAndTypeNames.java @@ -68,5 +68,6 @@ public interface PropertyAndTypeNames { String ODRL_AND_CONSTRAINT_ATTRIBUTE = ODRL_SCHEMA + "and"; String ODRL_OR_CONSTRAINT_ATTRIBUTE = ODRL_SCHEMA + "or"; String ODRL_XONE_CONSTRAINT_ATTRIBUTE = ODRL_SCHEMA + "xone"; + String ODRL_USE_ACTION_ATTRIBUTE = ODRL_SCHEMA + "use"; } diff --git a/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/DutyTest.java b/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/DutyTest.java index c4a7677f265..17e8d0c8f45 100644 --- a/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/DutyTest.java +++ b/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/DutyTest.java @@ -26,7 +26,7 @@ class DutyTest { @Test void serializeDeserialize() throws JsonProcessingException { var mapper = new ObjectMapper(); - var serialized = mapper.writeValueAsString(Duty.Builder.newInstance().action(Action.Builder.newInstance().type("USE").build()).build()); + var serialized = mapper.writeValueAsString(Duty.Builder.newInstance().action(Action.Builder.newInstance().type("use").build()).build()); assertThat(mapper.readValue(serialized, Duty.class).getAction()).isNotNull(); } diff --git a/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/PermissionTest.java b/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/PermissionTest.java index ce54bfce4b8..9d87a8533ff 100644 --- a/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/PermissionTest.java +++ b/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/PermissionTest.java @@ -26,7 +26,7 @@ class PermissionTest { @Test void serializeDeserialize() throws JsonProcessingException { var mapper = new ObjectMapper(); - var serialized = mapper.writeValueAsString(Permission.Builder.newInstance().action(Action.Builder.newInstance().type("USE").build()).build()); + var serialized = mapper.writeValueAsString(Permission.Builder.newInstance().action(Action.Builder.newInstance().type("use").build()).build()); assertThat(mapper.readValue(serialized, Permission.class).getAction()).isNotNull(); } diff --git a/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/PolicyTest.java b/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/PolicyTest.java index 2f6b66e83b4..00ecfbd80ef 100644 --- a/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/PolicyTest.java +++ b/spi/common/policy-model/src/test/java/org/eclipse/edc/policy/model/PolicyTest.java @@ -29,7 +29,7 @@ class PolicyTest { void serializeDeserialize() throws JsonProcessingException { var mapper = new ObjectMapper(); - var permission = Permission.Builder.newInstance().action(Action.Builder.newInstance().type("USE").build()).build(); + var permission = Permission.Builder.newInstance().action(Action.Builder.newInstance().type("use").build()).build(); var policy = Policy.Builder.newInstance().permission(permission).build(); var serialized = mapper.writeValueAsString(policy); @@ -39,7 +39,7 @@ void serializeDeserialize() throws JsonProcessingException { @Test void withTarget() { var target = "target-id"; - var permission = Permission.Builder.newInstance().action(Action.Builder.newInstance().type("USE").build()).build(); + var permission = Permission.Builder.newInstance().action(Action.Builder.newInstance().type("use").build()).build(); var prohibition = Prohibition.Builder.newInstance().action(Action.Builder.newInstance().type("MODIFY").build()).build(); var duty = Duty.Builder.newInstance().action(Action.Builder.newInstance().type("DELETE").build()).build(); var policy = Policy.Builder.newInstance() diff --git a/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/ContractNegotiationStoreTestBase.java b/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/ContractNegotiationStoreTestBase.java index f526cdfd3a3..8798202ec9d 100644 --- a/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/ContractNegotiationStoreTestBase.java +++ b/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/ContractNegotiationStoreTestBase.java @@ -564,7 +564,7 @@ void byPolicyAssignee() { .assigner("test-assigner") .permission(Permission.Builder.newInstance() .action(Action.Builder.newInstance() - .type("USE") + .type("use") .build()) .constraint(AtomicConstraint.Builder.newInstance() .leftExpression(new LiteralExpression("foo")) diff --git a/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/TestFunctions.java b/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/TestFunctions.java index 30800a12903..61af7435f2e 100644 --- a/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/TestFunctions.java +++ b/spi/control-plane/contract-spi/src/testFixtures/java/org/eclipse/edc/connector/contract/spi/testfixtures/negotiation/store/TestFunctions.java @@ -89,7 +89,7 @@ public static Policy createPolicy() { return Policy.Builder.newInstance() .permission(Permission.Builder.newInstance() .action(Action.Builder.newInstance() - .type("USE") + .type("use") .build()) .constraint(AtomicConstraint.Builder.newInstance() .leftExpression(new LiteralExpression("foo")) diff --git a/spi/control-plane/policy-spi/src/testFixtures/java/org/eclipse/edc/connector/policy/spi/testfixtures/store/PolicyDefinitionStoreTestBase.java b/spi/control-plane/policy-spi/src/testFixtures/java/org/eclipse/edc/connector/policy/spi/testfixtures/store/PolicyDefinitionStoreTestBase.java index 476c050627a..901186ce978 100644 --- a/spi/control-plane/policy-spi/src/testFixtures/java/org/eclipse/edc/connector/policy/spi/testfixtures/store/PolicyDefinitionStoreTestBase.java +++ b/spi/control-plane/policy-spi/src/testFixtures/java/org/eclipse/edc/connector/policy/spi/testfixtures/store/PolicyDefinitionStoreTestBase.java @@ -233,7 +233,7 @@ void whenPolicyExists_updatingPolicyFields() { var store = getPolicyDefinitionStore(); store.create(policy); - var action = Action.Builder.newInstance().type("UPDATED_USE").build(); + var action = Action.Builder.newInstance().type("play").build(); var updatedPermission = Permission.Builder.newInstance().action(action).build(); var updatedDuty = Duty.Builder.newInstance().action(action).build(); var updatedProhibition = Prohibition.Builder.newInstance().action(action).build();