Skip to content

Commit

Permalink
fix(jsonld): add missing ODRL mapping in ContractAgreement (#4517)
Browse files Browse the repository at this point in the history
* fix(jsonld): add missing ODRL mapping in ContractAgreement

* chore: deps file
  • Loading branch information
wolf4ood authored Oct 1, 2024
1 parent ded228d commit 6002ee7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
4 changes: 0 additions & 4 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@ maven/mavencentral/com.fasterxml.jackson.core/jackson-annotations/2.14.0, Apache
maven/mavencentral/com.fasterxml.jackson.core/jackson-annotations/2.14.1, Apache-2.0, approved, #5303
maven/mavencentral/com.fasterxml.jackson.core/jackson-annotations/2.16.2, Apache-2.0, approved, #11606
maven/mavencentral/com.fasterxml.jackson.core/jackson-annotations/2.17.1, Apache-2.0, approved, #13672
maven/mavencentral/com.fasterxml.jackson.core/jackson-annotations/2.17.2, Apache-2.0, approved, #13672
maven/mavencentral/com.fasterxml.jackson.core/jackson-annotations/2.18.0, Apache-2.0, approved, #16364
maven/mavencentral/com.fasterxml.jackson.core/jackson-core/2.14.1, Apache-2.0 AND MIT, approved, #4303
maven/mavencentral/com.fasterxml.jackson.core/jackson-core/2.16.2, Apache-2.0 AND MIT, approved, #11602
maven/mavencentral/com.fasterxml.jackson.core/jackson-core/2.17.2, Apache-2.0 AND MIT, approved, #13665
maven/mavencentral/com.fasterxml.jackson.core/jackson-core/2.18.0, Apache-2.0 AND MIT, approved, #16371
maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.11.0, Apache-2.0, approved, CQ23093
maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.14.0, Apache-2.0, approved, #4105
maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.14.1, Apache-2.0, approved, #15232
maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.16.2, Apache-2.0, approved, #11605
maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.17.1, Apache-2.0, approved, #13671
maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.17.2, Apache-2.0, approved, #13671
maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.18.0, Apache-2.0, approved, #16372
maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.14.0, Apache-2.0, approved, #5933
maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.16.2, Apache-2.0, approved, #11855
Expand All @@ -43,7 +40,6 @@ maven/mavencentral/com.fasterxml.jackson.jakarta.rs/jackson-jakarta-rs-json-prov
maven/mavencentral/com.fasterxml.jackson.module/jackson-module-jakarta-xmlbind-annotations/2.17.1, Apache-2.0, approved, #13668
maven/mavencentral/com.fasterxml.jackson.module/jackson-module-jakarta-xmlbind-annotations/2.18.0, Apache-2.0, approved, #16368
maven/mavencentral/com.fasterxml.jackson/jackson-bom/2.16.2, Apache-2.0, approved, #11852
maven/mavencentral/com.fasterxml.jackson/jackson-bom/2.17.2, Apache-2.0, approved, #14162
maven/mavencentral/com.fasterxml.jackson/jackson-bom/2.18.0, , restricted, clearlydefined
maven/mavencentral/com.fasterxml.uuid/java-uuid-generator/4.1.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.github.cliftonlabs/json-simple/3.0.2, Apache-2.0, approved, clearlydefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@
"CallbackAddress": "edc:CallbackAddress",
"NegotiationState": "edc:NegotiationState",
"TerminateNegotiation": "edc:TerminateNegotiation",
"ContractAgreement": "edc:ContractAgreement",
"ContractAgreement": {
"@id": "edc:ContractAgreement",
"@context": {
"@import": "http://www.w3.org/ns/odrl.jsonld",
"@propagate": true,
"uid": null,
"type": null
}
},
"TransferRequest": "edc:TransferRequest",
"TransferState": "edc:TransferState",
"TransferProcess": {
Expand Down Expand Up @@ -187,4 +195,4 @@
"@container": "@set"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ void ser_ContractAgreement() {
assertThat(compactResult.getString("providerId")).isEqualTo(agreement.getProviderId());
assertThat(compactResult.getString("consumerId")).isEqualTo(agreement.getConsumerId());
assertThat(compactResult.getString("assetId")).isEqualTo(agreement.getAssetId());
assertThat(compactResult.getJsonObject("policy")).isNotNull();
assertThat(compactResult.getJsonObject("policy")).isNotNull()
.satisfies(policy -> {
assertThat(policy.get(TYPE)).isEqualTo(Json.createValue("Agreement"));
});
assertThat(compactResult.getJsonNumber("contractSigningDate")).isNotNull();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.eclipse.edc.policy.model.AtomicConstraint;
import org.eclipse.edc.policy.model.LiteralExpression;
import org.eclipse.edc.policy.model.Policy;
import org.eclipse.edc.policy.model.PolicyType;
import org.eclipse.edc.policy.model.Rule;
import org.eclipse.edc.spi.types.domain.DataAddress;
import org.eclipse.edc.spi.types.domain.callback.CallbackAddress;
Expand Down Expand Up @@ -202,7 +203,7 @@ public static ContractAgreement createContractAgreement(String id) {
.providerId("providerId")
.consumerId("consumerId")
.assetId("assetId")
.policy(Policy.Builder.newInstance().build())
.policy(Policy.Builder.newInstance().type(PolicyType.CONTRACT).build())
.build();
}

Expand Down

0 comments on commit 6002ee7

Please sign in to comment.