From 65d37905f062c2b5841e08f927ec4cd3a190bbc2 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Wed, 15 May 2024 13:03:12 +0200 Subject: [PATCH] bug: #963 fix /contracts api --- CHANGELOG.md | 1 + pom.xml | 2 +- .../contracts/ContractControllerIT.java | 4 ++ ..._page_contractagreements_response_200.json | 60 +++++++++---------- .../one_contractagreement_response_200.json | 12 ++-- ..._page_contractagreements_response_200.json | 60 +++++++++---------- 6 files changed, 72 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11fe9b6505..d30dc94f33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha - #XXX Switched eclipse-temurin:21-jre-alpine@sha256:fb4150a30569aadae9d693d949684a00653411528e62498b9900940c9b5b8a66 to 23467b3e42617ca197f43f58bc5fb03ca4cb059d68acd49c67128bfded132d67 - #837 Moved data import and IrsResponseMappers under same interface and shared methods - #947 Updating irs-helm from 7.1.1 to 7.1.2 to use latest catena-x policy +- #963 update irs-client-lib.version from 2.0.3 to 2.0.4-SNAPSHOT to fix /contracts api ## [11.0.0 - 08.05.2024] ### Added diff --git a/pom.xml b/pom.xml index 6f6b9c91da..607394e9f4 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ SPDX-License-Identifier: Apache-2.0 7.17.0 5.10.2 4.2.1 - 2.0.3 + 2.0.4-SNAPSHOT 5.4.0 jacoco diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractControllerIT.java index 5b6d427303..6412e82d0f 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/contracts/ContractControllerIT.java @@ -90,6 +90,7 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException { .then() .log().all() .statusCode(200) + .log().all() .extract().body().as(new TypeRef<>() { }); @@ -111,7 +112,9 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException { List secondContractagreementIds = List.of("abc6", "abc7", "abc8", "abc9", "abc10"); assertThat(contractResponsePage1Result.content()).isNotEmpty(); + assertThat(contractResponsePage1Result.content().get(0).getCounterpartyAddress()).isNotEmpty(); assertThat(contractResponsePage2Result.content()).isNotEmpty(); + assertThat(contractResponsePage2Result.content().get(0).getCounterpartyAddress()).isNotEmpty(); assertThat(contractResponsePage1Result.content().stream().map(ContractResponse::getContractId).collect(Collectors.toList())).containsAll(firstContractagreementIds); assertThat(contractResponsePage2Result.content().stream().map(ContractResponse::getContractId).toList()).containsAll(secondContractagreementIds); @@ -139,6 +142,7 @@ void shouldReturnOnlyOneContract() throws JoseException { }); //THEN assertThat(contractResponsePageResult.content()).isNotEmpty(); + assertThat(contractResponsePageResult.content().get(0).getCounterpartyAddress()).isNotEmpty(); } @Test diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/first_page_contractagreements_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/first_page_contractagreements_response_200.json index 5f0f720079..31c43f0ca1 100644 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/first_page_contractagreements_response_200.json +++ b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/first_page_contractagreements_response_200.json @@ -1,9 +1,9 @@ [ { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc1", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -25,9 +25,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", @@ -38,10 +38,10 @@ } }, { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc2", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -63,9 +63,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", @@ -76,10 +76,10 @@ } }, { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc3", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -101,9 +101,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", @@ -114,10 +114,10 @@ } }, { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc4", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -139,9 +139,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", @@ -152,10 +152,10 @@ } }, { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc5", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -177,9 +177,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/one_contractagreement_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/one_contractagreement_response_200.json index 341a8b61b3..f75dd1e15e 100644 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/one_contractagreement_response_200.json +++ b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/one_contractagreement_response_200.json @@ -1,9 +1,9 @@ [ { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc1", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -25,9 +25,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/second_page_contractagreements_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/second_page_contractagreements_response_200.json index 13b119fcff..00aec9c955 100644 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/second_page_contractagreements_response_200.json +++ b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/second_page_contractagreements_response_200.json @@ -1,9 +1,9 @@ [ { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc6", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -25,9 +25,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", @@ -38,10 +38,10 @@ } }, { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc7", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -63,9 +63,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", @@ -76,10 +76,10 @@ } }, { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc8", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -101,9 +101,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", @@ -114,10 +114,10 @@ } }, { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc9", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -139,9 +139,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/", @@ -152,10 +152,10 @@ } }, { - "@type" : "edc:ContractAgreement", + "@type" : "ContractAgreement", "@id" : "abc10", - "edc:assetId" : "registry-asset", - "edc:policy" : { + "assetId" : "registry-asset", + "policy" : { "@id" : "eb0c8486-914a-4d36-84c0-b4971cbc52e4", "@type" : "odrl:Set", "odrl:permission" : { @@ -177,9 +177,9 @@ "odrl:obligation" : [], "odrl:target" : "registry-asset" }, - "edc:contractSigningDate" : 1708951087, - "edc:consumerId" : "BPNL00000003CML1", - "edc:providerId" : "BPNL00000003CML1", + "contractSigningDate" : 1708951087, + "consumerId" : "BPNL00000003CML1", + "providerId" : "BPNL00000003CML1", "@context" : { "dct" : "https://purl.org/dc/terms/", "tx" : "https://w3id.org/tractusx/v0.0.1/ns/",