Skip to content

Commit

Permalink
bug: #963 fix /contracts api
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-lcapellino committed May 15, 2024
1 parent 7eaeec6 commit 65d3790
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 67 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ SPDX-License-Identifier: Apache-2.0
<cucumber.version>7.17.0</cucumber.version>
<junit-bom.version>5.10.2</junit-bom.version>
<awaitility.version>4.2.1</awaitility.version>
<irs-client-lib.version>2.0.3</irs-client-lib.version>
<irs-client-lib.version>2.0.4-SNAPSHOT</irs-client-lib.version>
<json-schema-validator.version>5.4.0</json-schema-validator.version>
<!-- Sonar related properties -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException {
.then()
.log().all()
.statusCode(200)
.log().all()
.extract().body().as(new TypeRef<>() {
});

Expand All @@ -111,7 +112,9 @@ void shouldReturnNextPageOfPaginatedContracts() throws JoseException {
List<String> 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);
Expand Down Expand Up @@ -139,6 +142,7 @@ void shouldReturnOnlyOneContract() throws JoseException {
});
//THEN
assertThat(contractResponsePageResult.content()).isNotEmpty();
assertThat(contractResponsePageResult.content().get(0).getCounterpartyAddress()).isNotEmpty();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -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" : {
Expand All @@ -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/",
Expand All @@ -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" : {
Expand All @@ -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/",
Expand All @@ -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" : {
Expand All @@ -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/",
Expand All @@ -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" : {
Expand All @@ -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/",
Expand All @@ -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" : {
Expand All @@ -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/",
Expand Down
Original file line number Diff line number Diff line change
@@ -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" : {
Expand All @@ -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/",
Expand Down
Original file line number Diff line number Diff line change
@@ -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" : {
Expand All @@ -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/",
Expand All @@ -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" : {
Expand All @@ -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/",
Expand All @@ -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" : {
Expand All @@ -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/",
Expand All @@ -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" : {
Expand All @@ -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/",
Expand All @@ -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" : {
Expand All @@ -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/",
Expand Down

0 comments on commit 65d3790

Please sign in to comment.