diff --git a/advanced/advanced-01-open-telemetry/README.md b/advanced/advanced-01-open-telemetry/README.md index 31aedd80..33d85f9a 100644 --- a/advanced/advanced-01-open-telemetry/README.md +++ b/advanced/advanced-01-open-telemetry/README.md @@ -42,7 +42,7 @@ Create an asset: ```bash curl -H "X-Api-Key: password" \ -d @advanced/advanced-01-open-telemetry/resources/create-asset.json \ - -H 'content-type: application/json' http://localhost:19193/management/v3/assets \ + -H 'content-type: application/json' http://localhost:19193/management/v4/assets \ -s | jq ``` @@ -51,7 +51,7 @@ Create a Policy on the provider connector: ```bash curl -H "X-Api-Key: password" \ -d @advanced/advanced-01-open-telemetry/resources/create-policy.json \ - -H 'content-type: application/json' http://localhost:19193/management/v3/policydefinitions \ + -H 'content-type: application/json' http://localhost:19193/management/v4/policydefinitions \ -s | jq ``` @@ -60,7 +60,7 @@ Follow up with the creation of a contract definition: ```bash curl -H "X-Api-Key: password" \ -d @advanced/advanced-01-open-telemetry/resources/create-contract-definition.json \ - -H 'content-type: application/json' http://localhost:19193/management/v3/contractdefinitions \ + -H 'content-type: application/json' http://localhost:19193/management/v4/contractdefinitions \ -s | jq ``` @@ -72,7 +72,7 @@ directly with this call: curl -H "X-Api-Key: password" \ -H "Content-Type: application/json" \ -d @advanced/advanced-01-open-telemetry/resources/get-dataset.json \ - -X POST "http://localhost:29193/management/v3/catalog/dataset/request" \ + -X POST "http://localhost:29193/management/v4/catalog/dataset/request" \ -s | jq ``` @@ -141,7 +141,7 @@ and request the contract negotiation: curl -H "X-Api-Key: password" \ -H "Content-Type: application/json" \ -d @advanced/advanced-01-open-telemetry/resources/negotiate-contract.json \ - -X POST "http://localhost:29193/management/v3/contractnegotiations" \ + -X POST "http://localhost:29193/management/v4/contractnegotiations" \ -s | jq ``` @@ -150,7 +150,7 @@ state with this call, replacing `{{contract-negotiation-id}}` with the id return ```shell curl -H 'X-Api-Key: password' \ - -X GET "http://localhost:29193/management/v3/contractnegotiations/{{contract-negotiation-id}}" \ + -X GET "http://localhost:29193/management/v4/contractnegotiations/{{contract-negotiation-id}}" \ -s | jq ``` @@ -160,7 +160,7 @@ Finally, update the contract agreement id in the [start-transfer.json](resources curl -H "X-Api-Key: password" \ -H "Content-Type: application/json" \ -d @advanced/advanced-01-open-telemetry/resources/start-transfer.json \ - -X POST "http://localhost:29193/management/v3/transferprocesses" \ + -X POST "http://localhost:29193/management/v4/transferprocesses" \ -s | jq ``` diff --git a/advanced/advanced-01-open-telemetry/resources/create-asset.json b/advanced/advanced-01-open-telemetry/resources/create-asset.json index 018e9f6e..9280f30e 100644 --- a/advanced/advanced-01-open-telemetry/resources/create-asset.json +++ b/advanced/advanced-01-open-telemetry/resources/create-asset.json @@ -2,6 +2,7 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, + "@type": "Asset", "@id": "assetId", "properties": { "name": "product description", diff --git a/advanced/advanced-01-open-telemetry/resources/create-contract-definition.json b/advanced/advanced-01-open-telemetry/resources/create-contract-definition.json index 5ee5c67f..eca6b5ea 100644 --- a/advanced/advanced-01-open-telemetry/resources/create-contract-definition.json +++ b/advanced/advanced-01-open-telemetry/resources/create-contract-definition.json @@ -2,6 +2,7 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, + "@type": "ContractDefinition", "@id": "1", "accessPolicyId": "aPolicy", "contractPolicyId": "aPolicy", diff --git a/advanced/advanced-01-open-telemetry/resources/create-policy.json b/advanced/advanced-01-open-telemetry/resources/create-policy.json index cf7a4703..4dd5356a 100644 --- a/advanced/advanced-01-open-telemetry/resources/create-policy.json +++ b/advanced/advanced-01-open-telemetry/resources/create-policy.json @@ -3,6 +3,7 @@ "@vocab": "https://w3id.org/edc/v0.0.1/ns/", "odrl": "http://www.w3.org/ns/odrl/2/" }, + "@type": "PolicyDefinition", "@id": "aPolicy", "policy": { "@context": "http://www.w3.org/ns/odrl.jsonld", diff --git a/advanced/advanced-01-open-telemetry/resources/start-transfer.json b/advanced/advanced-01-open-telemetry/resources/start-transfer.json index 017852e7..61ba0215 100644 --- a/advanced/advanced-01-open-telemetry/resources/start-transfer.json +++ b/advanced/advanced-01-open-telemetry/resources/start-transfer.json @@ -2,7 +2,7 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, - "@type": "TransferRequestDto", + "@type": "TransferRequest", "connectorId": "provider", "counterPartyAddress": "http://provider:19194/protocol/2025-1", "contractId": "{{contract-agreement-id}}", diff --git a/basic/basic-04-event-consumer/README.md b/basic/basic-04-event-consumer/README.md index 2c43529c..3b6a1671 100644 --- a/basic/basic-04-event-consumer/README.md +++ b/basic/basic-04-event-consumer/README.md @@ -52,7 +52,7 @@ java -Dedc.fs.config=basic/basic-04-event-consumer/resources/configuration/consu ```bash curl -d @basic/basic-04-event-consumer/resources/create-asset.json \ - -X POST -H 'content-type: application/json' http://localhost:29193/management/v3/assets \ + -X POST -H 'content-type: application/json' http://localhost:29193/management/v4/assets \ -s | jq ``` diff --git a/basic/basic-04-event-consumer/resources/create-asset.json b/basic/basic-04-event-consumer/resources/create-asset.json index 018e9f6e..9280f30e 100644 --- a/basic/basic-04-event-consumer/resources/create-asset.json +++ b/basic/basic-04-event-consumer/resources/create-asset.json @@ -2,6 +2,7 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, + "@type": "Asset", "@id": "assetId", "properties": { "name": "product description", diff --git a/federated-catalog/fc-00-basic/README.md b/federated-catalog/fc-00-basic/README.md index 0aee7551..98fbfbaa 100644 --- a/federated-catalog/fc-00-basic/README.md +++ b/federated-catalog/fc-00-basic/README.md @@ -76,20 +76,20 @@ Once the connector is running, carry out the commands below in sequence. #### Create an asset ```shell curl -d @federated-catalog/fc-00-basic/participant-connector/resources/create-asset.json \ - -H 'content-type: application/json' http://localhost:19193/management/v3/assets \ + -H 'content-type: application/json' http://localhost:19193/management/v4/assets \ -s | jq ``` #### Create a policy ```bash curl -d @federated-catalog/fc-00-basic/participant-connector/resources/create-policy.json \ - -H 'content-type: application/json' http://localhost:19193/management/v3/policydefinitions \ + -H 'content-type: application/json' http://localhost:19193/management/v4/policydefinitions \ -s | jq ``` #### Create a contract definition ```bash curl -d @federated-catalog/fc-00-basic/participant-connector/resources/create-contract-definition.json \ - -H 'content-type: application/json' http://localhost:19193/management/v3/contractdefinitions \ + -H 'content-type: application/json' http://localhost:19193/management/v4/contractdefinitions \ -s | jq ``` diff --git a/federated-catalog/fc-00-basic/participant-connector/resources/create-asset.json b/federated-catalog/fc-00-basic/participant-connector/resources/create-asset.json index 018e9f6e..9280f30e 100644 --- a/federated-catalog/fc-00-basic/participant-connector/resources/create-asset.json +++ b/federated-catalog/fc-00-basic/participant-connector/resources/create-asset.json @@ -2,6 +2,7 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, + "@type": "Asset", "@id": "assetId", "properties": { "name": "product description", diff --git a/federated-catalog/fc-00-basic/participant-connector/resources/create-contract-definition.json b/federated-catalog/fc-00-basic/participant-connector/resources/create-contract-definition.json index 5ee5c67f..eca6b5ea 100644 --- a/federated-catalog/fc-00-basic/participant-connector/resources/create-contract-definition.json +++ b/federated-catalog/fc-00-basic/participant-connector/resources/create-contract-definition.json @@ -2,6 +2,7 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, + "@type": "ContractDefinition", "@id": "1", "accessPolicyId": "aPolicy", "contractPolicyId": "aPolicy", diff --git a/federated-catalog/fc-00-basic/participant-connector/resources/create-policy.json b/federated-catalog/fc-00-basic/participant-connector/resources/create-policy.json index cf7a4703..4dd5356a 100644 --- a/federated-catalog/fc-00-basic/participant-connector/resources/create-policy.json +++ b/federated-catalog/fc-00-basic/participant-connector/resources/create-policy.json @@ -3,6 +3,7 @@ "@vocab": "https://w3id.org/edc/v0.0.1/ns/", "odrl": "http://www.w3.org/ns/odrl/2/" }, + "@type": "PolicyDefinition", "@id": "aPolicy", "policy": { "@context": "http://www.w3.org/ns/odrl.jsonld", diff --git a/federated-catalog/fc-01-embedded/README.md b/federated-catalog/fc-01-embedded/README.md index edd74b21..b5140883 100644 --- a/federated-catalog/fc-01-embedded/README.md +++ b/federated-catalog/fc-01-embedded/README.md @@ -90,7 +90,7 @@ Use the following request to invoke the catalog API: curl -d @federated-catalog/fc-01-embedded/resources/empty-query.json \ -H 'content-type: application/json' \ -H 'x-api-key: password' \ - http://localhost:29193/api/management/v3/catalogs/request \ + http://localhost:29193/api/management/v4/catalogs/request \ -s | jq ``` diff --git a/federated-catalog/fc-02-standalone/README.md b/federated-catalog/fc-02-standalone/README.md index 1bfa22d8..db602090 100644 --- a/federated-catalog/fc-02-standalone/README.md +++ b/federated-catalog/fc-02-standalone/README.md @@ -70,7 +70,7 @@ To get the combined set of catalogs, use the following request: ```http request curl -d @federated-catalog/fc-01-embedded/resources/empty-query.json \ -H 'content-type: application/json' \ - http://localhost:39193/api/management/v3/catalogs/request \ + http://localhost:39193/api/management/v4/catalogs/request \ -s | jq ``` diff --git a/federated-catalog/fc-03-static-node-directory/README.md b/federated-catalog/fc-03-static-node-directory/README.md index aea3b170..37c400c9 100644 --- a/federated-catalog/fc-03-static-node-directory/README.md +++ b/federated-catalog/fc-03-static-node-directory/README.md @@ -105,7 +105,7 @@ To get the combined set of catalogs, use the following request: ```http request curl -d @federated-catalog/fc-01-embedded/resources/empty-query.json \ -H 'content-type: application/json' \ - http://localhost:39193/api/management/v3/catalogs/request \ + http://localhost:39193/api/management/v4/catalogs/request \ -s | jq ``` @@ -137,6 +137,6 @@ To get the combined set of catalogs, use the following request: curl -d @federated-catalog/fc-01-embedded/resources/empty-query.json \ -H 'content-type: application/json' \ -H 'x-api-key: password' \ - http://localhost:29193/api/management/v3/catalogs/request \ + http://localhost:29193/api/management/v4/catalogs/request \ -s | jq ``` diff --git a/policy/policy-01-policy-enforcement/README.md b/policy/policy-01-policy-enforcement/README.md index 70c1c121..c58abbdc 100644 --- a/policy/policy-01-policy-enforcement/README.md +++ b/policy/policy-01-policy-enforcement/README.md @@ -180,7 +180,7 @@ sufficient for our example. You can view the request body for creating the asset ```bash curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" \ -d @policy/policy-01-policy-enforcement/resources/create-asset.json \ - "http://localhost:19193/management/v3/assets" | jq + "http://localhost:19193/management/v4/assets" | jq ``` #### 2.2 Create the policy definition @@ -200,7 +200,7 @@ be equal to `eu`. You can view the request body for creating the policy definiti ```bash curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" \ -d @policy/policy-01-policy-enforcement/resources/create-policy.json \ - "http://localhost:19193/management/v3/policydefinitions" | jq + "http://localhost:19193/management/v4/policydefinitions" | jq ``` #### 2.3 Create the contract definition @@ -216,7 +216,7 @@ the contract definition: ```bash curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" \ -d @policy/policy-01-policy-enforcement/resources/create-contract-definition.json \ - "http://localhost:19193/management/v3/contractdefinitions" | jq + "http://localhost:19193/management/v4/contractdefinitions" | jq ``` With this, the provider now offers the asset under the condition that the requesting participant is located in the EU. @@ -230,7 +230,7 @@ in the request. The request body is prepared in [catalog-request.json](resources ```bash curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" \ -d @policy/policy-01-policy-enforcement/resources/catalog-request.json \ - "http://localhost:29193/management/v3/catalog/request" | jq + "http://localhost:29193/management/v4/catalog/request" | jq ``` We'll receive the following catalog in the response, where we can see the offer created in the provider's extension. @@ -303,7 +303,7 @@ which protocol to use and which offer we want to negotiate. The request body is ```bash curl -X POST -H "Content-Type: application/json" -H "X-Api-Key: password" \ -d @policy/policy-01-policy-enforcement/resources/contract-request.json \ - "http://localhost:29193/management/v3/contractnegotiations" | jq + "http://localhost:29193/management/v4/contractnegotiations" | jq ``` You'll get back a UUID. This is the ID of the contract negotiation process which is being asynchronously executed @@ -315,7 +315,7 @@ Using the ID received in the previous step, we can now view the state of the neg of the consumer's management API: ```bash -curl -X GET -H "X-Api-Key: password" "http://localhost:29193/management/v3/contractnegotiations/" | jq +curl -X GET -H "X-Api-Key: password" "http://localhost:29193/management/v4/contractnegotiations/" | jq ``` In the response we'll get a description of the negotiation, similar to the following: diff --git a/policy/policy-01-policy-enforcement/resources/catalog-request.json b/policy/policy-01-policy-enforcement/resources/catalog-request.json index 28a0a7e7..90b851c7 100644 --- a/policy/policy-01-policy-enforcement/resources/catalog-request.json +++ b/policy/policy-01-policy-enforcement/resources/catalog-request.json @@ -2,6 +2,7 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, + "@type": "CatalogRequest", "counterPartyId": "provider", "counterPartyAddress": "http://localhost:19194/protocol/2025-1", "protocol": "dataspace-protocol-http:2025-1" diff --git a/policy/policy-01-policy-enforcement/resources/create-asset.json b/policy/policy-01-policy-enforcement/resources/create-asset.json index b34f9042..686a80c6 100644 --- a/policy/policy-01-policy-enforcement/resources/create-asset.json +++ b/policy/policy-01-policy-enforcement/resources/create-asset.json @@ -2,6 +2,7 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, + "@type": "Asset", "@id": "test-document", "properties": { "name": "product description", diff --git a/policy/policy-01-policy-enforcement/resources/create-contract-definition.json b/policy/policy-01-policy-enforcement/resources/create-contract-definition.json index 16d2d4d3..640666fe 100644 --- a/policy/policy-01-policy-enforcement/resources/create-contract-definition.json +++ b/policy/policy-01-policy-enforcement/resources/create-contract-definition.json @@ -2,11 +2,12 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, + "@type": "ContractDefinition", "@id": "1", "accessPolicyId": "eu-policy", "contractPolicyId": "eu-policy", "assetsSelector": [{ - "@type": "CriterionDto", + "@type": "Criterion", "operandLeft": "https://w3id.org/edc/v0.0.1/ns/id", "operator": "=", "operandRight": "test-document" diff --git a/policy/policy-01-policy-enforcement/resources/create-policy.json b/policy/policy-01-policy-enforcement/resources/create-policy.json index b31e2801..ff863058 100644 --- a/policy/policy-01-policy-enforcement/resources/create-policy.json +++ b/policy/policy-01-policy-enforcement/resources/create-policy.json @@ -2,6 +2,7 @@ "@context": { "@vocab": "https://w3id.org/edc/v0.0.1/ns/" }, + "@type": "PolicyDefinition", "@id": "eu-policy", "policy": { "@context": "http://www.w3.org/ns/odrl.jsonld", diff --git a/system-tests/src/test/java/org/eclipse/edc/samples/basic/Basic04eventConsumerTest.java b/system-tests/src/test/java/org/eclipse/edc/samples/basic/Basic04eventConsumerTest.java index 6060b3d0..2fb80339 100644 --- a/system-tests/src/test/java/org/eclipse/edc/samples/basic/Basic04eventConsumerTest.java +++ b/system-tests/src/test/java/org/eclipse/edc/samples/basic/Basic04eventConsumerTest.java @@ -35,7 +35,7 @@ class Basic04eventConsumerTest { private static final String CONNECTOR_MODULE_PATH = ":basic:basic-04-event-consumer:connector-with-event-subscriber"; private static final String CONFIG_PROPERTIES_FILE_PATH = "basic/basic-04-event-consumer/resources/configuration/consumer-configuration.properties"; private static final String CREATE_ASSET_FILE_PATH = "basic/basic-04-event-consumer/resources/create-asset.json"; - private static final String V3_ASSETS_PATH = "/v3/assets"; + private static final String ASSETS_PATH = "/v4/assets"; @RegisterExtension static RuntimeExtension connector = getConsumer(CONNECTOR_MODULE_PATH, CONFIG_PROPERTIES_FILE_PATH); @@ -45,7 +45,7 @@ void runSampleSteps() { var standardOutputStream = new ByteArrayOutputStream(); System.setOut(new PrintStream(standardOutputStream)); - post(CONSUMER_MANAGEMENT_URL + V3_ASSETS_PATH, getFileContentFromRelativePath(CREATE_ASSET_FILE_PATH)); + post(CONSUMER_MANAGEMENT_URL + ASSETS_PATH, getFileContentFromRelativePath(CREATE_ASSET_FILE_PATH)); var standardOutput = standardOutputStream.toString(); assertThat(standardOutput).contains("Asset created:"); diff --git a/system-tests/src/test/java/org/eclipse/edc/samples/common/FederatedCatalogCommon.java b/system-tests/src/test/java/org/eclipse/edc/samples/common/FederatedCatalogCommon.java index 3c2dc2e9..be90ee11 100644 --- a/system-tests/src/test/java/org/eclipse/edc/samples/common/FederatedCatalogCommon.java +++ b/system-tests/src/test/java/org/eclipse/edc/samples/common/FederatedCatalogCommon.java @@ -41,7 +41,7 @@ public class FederatedCatalogCommon { public static final String CREATE_ASSET_FILE_PATH = "federated-catalog/fc-00-basic/participant-connector/resources/create-asset.json"; public static final String CREATE_POLICY_FILE_PATH = "federated-catalog/fc-00-basic/participant-connector/resources/create-policy.json"; public static final String CREATE_CONTRACT_DEFINITION_FILE_PATH = "federated-catalog/fc-00-basic/participant-connector/resources/create-contract-definition.json"; - private static final String V3_ASSETS_PATH = "/v3/assets"; + private static final String ASSETS_PATH = "/v4/assets"; private static final String STANDALONE_FC = "standalone-fc"; private static final String EMBEDDED_FC = "fc-connector"; @@ -54,11 +54,11 @@ public class FederatedCatalogCommon { public static final int CRAWLER_EXECUTION_PERIOD_VALUE = 5; public static final int TIMEOUT = 5 * CRAWLER_EXECUTION_PERIOD_VALUE; - public static final String EMBEDDED_FC_CATALOG_API_ENDPOINT = "http://localhost:29193/api/management/v3/catalogs/request"; - public static final String STANDALONE_FC_CATALOG_API_ENDPOINT = "http://localhost:39193/api/management/v3/catalogs/request"; + public static final String EMBEDDED_FC_CATALOG_API_ENDPOINT = "http://localhost:29193/api/management/v4/catalogs/request"; + public static final String STANDALONE_FC_CATALOG_API_ENDPOINT = "http://localhost:39193/api/management/v4/catalogs/request"; public static final String EMPTY_QUERY_FILE_PATH = "federated-catalog/fc-01-embedded/resources/empty-query.json"; public static final String TYPE = "[0].@type"; - public static final String DATASET_ASSET_ID = "[0].dataset[0].@id"; + public static final String DATASET_ASSET_ID = "[0].'dcat:dataset'.@id"; public static RuntimeExtension getParticipantConnector() { return PrerequisitesCommon.getProvider(PARTICIPANT_CONNECTOR_MODULE_PATH, PARTICIPANT_CONNECTOR_CONFIG_PROPERTIES_FILE_PATH); @@ -87,7 +87,7 @@ private static RuntimeExtension getRuntime( } public static String createAsset() { - return post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + V3_ASSETS_PATH, + return post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + ASSETS_PATH, getFileContentFromRelativePath(CREATE_ASSET_FILE_PATH), ID); } @@ -103,7 +103,7 @@ public static JsonPath postAndAssertType(String url, String requestBody) { .log().ifValidationFails() .statusCode(HttpStatus.SC_OK) .body(TYPE, not(emptyString())) - .body(TYPE, is("Catalog")) + .body(TYPE, is("dcat:Catalog")) .extract() .jsonPath(); } diff --git a/system-tests/src/test/java/org/eclipse/edc/samples/common/NegotiationCommon.java b/system-tests/src/test/java/org/eclipse/edc/samples/common/NegotiationCommon.java index 15fd6635..4527bfdf 100644 --- a/system-tests/src/test/java/org/eclipse/edc/samples/common/NegotiationCommon.java +++ b/system-tests/src/test/java/org/eclipse/edc/samples/common/NegotiationCommon.java @@ -27,31 +27,31 @@ public class NegotiationCommon { - private static final String V3_ASSETS_PATH = "/v3/assets"; - private static final String V2_POLICY_DEFINITIONS_PATH = "/v3/policydefinitions"; - private static final String V2_CONTRACT_DEFINITIONS_PATH = "/v3/contractdefinitions"; - private static final String V2_CATALOG_DATASET_REQUEST_PATH = "/v3/catalog/dataset/request"; + private static final String ASSETS_PATH = "/v4/assets"; + private static final String POLICY_DEFINITIONS_PATH = "/v4/policydefinitions"; + private static final String CONTRACT_DEFINITIONS_PATH = "/v4/contractdefinitions"; + private static final String CATALOG_DATASET_REQUEST_PATH = "/v4/catalog/dataset/request"; private static final String CATALOG_DATASET_ID = "\"hasPolicy\"[0].'@id'"; - private static final String V2_CONTRACT_NEGOTIATIONS_PATH = "/v3/contractnegotiations/"; + private static final String CONTRACT_NEGOTIATIONS_PATH = "/v4/contractnegotiations/"; private static final String CONTRACT_NEGOTIATION_ID = "@id"; private static final String CONTRACT_AGREEMENT_ID = "contractAgreementId"; private static final String CONTRACT_OFFER_ID_KEY = "{{contract-offer-id}}"; public static void createAsset(String createAssetFilePath) { - post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + V3_ASSETS_PATH, getFileContentFromRelativePath(createAssetFilePath)); + post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + ASSETS_PATH, getFileContentFromRelativePath(createAssetFilePath)); } public static void createPolicy(String createPolicyFilePath) { - post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + V2_POLICY_DEFINITIONS_PATH, getFileContentFromRelativePath(createPolicyFilePath)); + post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + POLICY_DEFINITIONS_PATH, getFileContentFromRelativePath(createPolicyFilePath)); } public static void createContractDefinition(String createContractDefinitionFilePath) { - post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + V2_CONTRACT_DEFINITIONS_PATH, getFileContentFromRelativePath(createContractDefinitionFilePath)); + post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + CONTRACT_DEFINITIONS_PATH, getFileContentFromRelativePath(createContractDefinitionFilePath)); } public static String fetchDatasetFromCatalog(String fetchDatasetFromCatalogFilePath) { var catalogDatasetId = post( - PrerequisitesCommon.CONSUMER_MANAGEMENT_URL + V2_CATALOG_DATASET_REQUEST_PATH, + PrerequisitesCommon.CONSUMER_MANAGEMENT_URL + CATALOG_DATASET_REQUEST_PATH, getFileContentFromRelativePath(fetchDatasetFromCatalogFilePath), CATALOG_DATASET_ID ); @@ -63,7 +63,7 @@ public static String negotiateContract(String negotiateContractFilePath, String var requestBody = getFileContentFromRelativePath(negotiateContractFilePath) .replace(CONTRACT_OFFER_ID_KEY, catalogDatasetId); var contractNegotiationId = post( - PrerequisitesCommon.CONSUMER_MANAGEMENT_URL + V2_CONTRACT_NEGOTIATIONS_PATH, + PrerequisitesCommon.CONSUMER_MANAGEMENT_URL + CONTRACT_NEGOTIATIONS_PATH, requestBody, CONTRACT_NEGOTIATION_ID ); @@ -72,7 +72,7 @@ public static String negotiateContract(String negotiateContractFilePath, String } public static String getContractAgreementId(String contractNegotiationId) { - var url = PrerequisitesCommon.CONSUMER_MANAGEMENT_URL + V2_CONTRACT_NEGOTIATIONS_PATH + contractNegotiationId; + var url = PrerequisitesCommon.CONSUMER_MANAGEMENT_URL + CONTRACT_NEGOTIATIONS_PATH + contractNegotiationId; return await() .atMost(TIMEOUT) .pollInterval(POLL_INTERVAL) @@ -80,7 +80,7 @@ public static String getContractAgreementId(String contractNegotiationId) { } public static String getContractNegotiationState(String contractNegotiationId) { - var url = PrerequisitesCommon.CONSUMER_MANAGEMENT_URL + V2_CONTRACT_NEGOTIATIONS_PATH + contractNegotiationId; + var url = PrerequisitesCommon.CONSUMER_MANAGEMENT_URL + CONTRACT_NEGOTIATIONS_PATH + contractNegotiationId; return get(url, "state"); } } diff --git a/system-tests/src/test/java/org/eclipse/edc/samples/common/PolicyCommon.java b/system-tests/src/test/java/org/eclipse/edc/samples/common/PolicyCommon.java index 57914df0..508b3ad4 100644 --- a/system-tests/src/test/java/org/eclipse/edc/samples/common/PolicyCommon.java +++ b/system-tests/src/test/java/org/eclipse/edc/samples/common/PolicyCommon.java @@ -19,20 +19,20 @@ public class PolicyCommon { - private static final String V3_ASSETS_PATH = "/v3/assets"; - private static final String V2_POLICY_DEFINITIONS_PATH = "/v3/policydefinitions"; - private static final String V2_CONTRACT_DEFINITIONS_PATH = "/v3/contractdefinitions"; - + private static final String ASSETS_PATH = "/v4/assets"; + private static final String POLICY_DEFINITIONS_PATH = "/v4/policydefinitions"; + private static final String CONTRACT_DEFINITIONS_PATH = "/v4/contractdefinitions"; + public static void createAsset(String createAssetFilePath) { - post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + V3_ASSETS_PATH, getFileContentFromRelativePath(createAssetFilePath)); + post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + ASSETS_PATH, getFileContentFromRelativePath(createAssetFilePath)); } - + public static void createPolicy(String createPolicyFilePath) { - post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + V2_POLICY_DEFINITIONS_PATH, getFileContentFromRelativePath(createPolicyFilePath)); + post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + POLICY_DEFINITIONS_PATH, getFileContentFromRelativePath(createPolicyFilePath)); } - + public static void createContractDefinition(String createContractDefinitionFilePath) { - post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + V2_CONTRACT_DEFINITIONS_PATH, getFileContentFromRelativePath(createContractDefinitionFilePath)); + post(PrerequisitesCommon.PROVIDER_MANAGEMENT_URL + CONTRACT_DEFINITIONS_PATH, getFileContentFromRelativePath(createContractDefinitionFilePath)); } } diff --git a/system-tests/src/test/java/org/eclipse/edc/samples/util/TransferUtil.java b/system-tests/src/test/java/org/eclipse/edc/samples/util/TransferUtil.java index 85291100..d717c61e 100644 --- a/system-tests/src/test/java/org/eclipse/edc/samples/util/TransferUtil.java +++ b/system-tests/src/test/java/org/eclipse/edc/samples/util/TransferUtil.java @@ -39,7 +39,7 @@ public class TransferUtil { public static final Duration POLL_INTERVAL = Duration.ofMillis(500); private static final String CONTRACT_AGREEMENT_ID_KEY = "{{contract-agreement-id}}"; - private static final String V2_TRANSFER_PROCESSES_PATH = "/v3/transferprocesses/"; + private static final String TRANSFER_PROCESSES_PATH = "/v4/transferprocesses/"; private static final String EDC_STATE = "state"; public static void get(String url) { @@ -90,7 +90,7 @@ public static String post(String url, String requestBody, String jsonPath) { public static String startTransfer(String requestBody, String contractAgreementId) { requestBody = requestBody.replace(CONTRACT_AGREEMENT_ID_KEY, contractAgreementId); - return post(CONSUMER_MANAGEMENT_URL + V2_TRANSFER_PROCESSES_PATH, requestBody, ID); + return post(CONSUMER_MANAGEMENT_URL + TRANSFER_PROCESSES_PATH, requestBody, ID); } public static void checkTransferStatus(String transferProcessId, TransferProcessStates status) { @@ -99,7 +99,7 @@ public static void checkTransferStatus(String transferProcessId, TransferProcess .pollDelay(POLL_DELAY) .pollInterval(POLL_INTERVAL) .untilAsserted(() -> { - var state = get(CONSUMER_MANAGEMENT_URL + V2_TRANSFER_PROCESSES_PATH + transferProcessId, EDC_STATE); + var state = get(CONSUMER_MANAGEMENT_URL + TRANSFER_PROCESSES_PATH + transferProcessId, EDC_STATE); assertThat(state).isEqualTo(status.name()); }); }