Skip to content

Commit

Permalink
Merge pull request #481 from catenax-ng/feature/420-add-contractagree…
Browse files Browse the repository at this point in the history
…ments

feature: 420 add policy to request
  • Loading branch information
ds-mwesener authored Mar 11, 2024
2 parents 6aa3de4 + 7451694 commit 65a4233
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ public record EdcContractAgreementsResponse(@JsonProperty("@id") String contract
@JsonProperty("edc:consumerId") String consumerId,
@JsonProperty("edc:contractSigningDate") long contractSigningDate,
@JsonProperty("edc:assetId") String assetId,
@JsonProperty("@type") String type) {
@JsonProperty("@type") String type,
@JsonProperty("edc:policy") Object policy) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ void shouldReturnContractAgreements() throws ContractAgreementException {
List<String> contractAgreementIds = List.of("contractAgreementId");

final EdcContractAgreementsResponse[] edcContractAgreementsResponse = new EdcContractAgreementsResponse[1];
edcContractAgreementsResponse[0] = EdcContractAgreementsResponse.builder().contractAgreementId("id")
edcContractAgreementsResponse[0] = EdcContractAgreementsResponse.builder()
.contractAgreementId("id")
.assetId("assetId")
.consumerId("consumerId")
.providerId("providerId")
.policy("theProvidedPolicy")
.build();
when(restTemplate.exchange(anyString(), eq(HttpMethod.POST), any(),
eq(EdcContractAgreementsResponse[].class))).thenReturn(
Expand All @@ -88,6 +90,8 @@ void shouldReturnContractAgreements() throws ContractAgreementException {
eq("https://irs-consumer-controlplane.dev.demo.net/data/management/v2/contractagreements/request"),
any(), any(), eq(EdcContractAgreementsResponse[].class));
assertThat(contractAgreements).isNotNull();
assertThat(contractAgreements.get(0).policy()).isNotNull();

}

@Test
Expand Down

0 comments on commit 65a4233

Please sign in to comment.