Skip to content

Commit

Permalink
feature: 420 refactor unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-lcapellino committed Feb 29, 2024
1 parent f9baa51 commit 2cd24cc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class EdcContractAgreementServiceTest {
@BeforeEach
void setUp() {
edcConfiguration.getControlplane().setEndpoint(new EdcConfiguration.ControlplaneConfig.EndpointConfig());
edcConfiguration.getControlplane().getEndpoint().setData("https://irs-consumer-controlplane.dev.demo.catena-x.net/data/management");
edcConfiguration.getControlplane().getEndpoint().setData("https://irs-consumer-controlplane.dev.demo.net/data/management");
edcConfiguration.getControlplane().getEndpoint().setContractAgreements("/v2/contractagreements");
this.edcContractAgreementService = new EdcContractAgreementService(edcConfiguration, restTemplate);
}
Expand Down Expand Up @@ -90,7 +90,7 @@ void shouldReturnContractAgreements() throws ContractAgreementException {

//THEN
Mockito.verify(restTemplate)
.postForEntity(eq("https://irs-consumer-controlplane.dev.demo.catena-x.net/data/management/v2/contractagreements/request"), any(),
.postForEntity(eq("https://irs-consumer-controlplane.dev.demo.net/data/management/v2/contractagreements/request"), any(),
eq(EdcContractAgreementsResponse.class));
assertNotNull(contractAgreements);
}
Expand All @@ -109,7 +109,7 @@ void shouldThrowContractAgreementExceptionWhenResponseBodyIsEmtpy() {

//THEN
Mockito.verify(restTemplate)
.postForEntity(eq("https://irs-consumer-controlplane.dev.demo.catena-x.net/data/management/v2/contractagreements/request"), any(),
.postForEntity(eq("https://irs-consumer-controlplane.dev.demo.net/data/management/v2/contractagreements/request"), any(),
eq(EdcContractAgreementsResponse.class));
assertEquals("Empty message body on edc response: <200 OK OK,[]>", contractAgreementException.getMessage());
}
Expand All @@ -134,7 +134,7 @@ void shouldReturnContractAgreementNegotiation() {

//THEN
Mockito.verify(restTemplate)
.getForEntity("https://irs-consumer-controlplane.dev.demo.catena-x.net/data/management/v2/contractagreements/contractAgreementId/negotiation",
.getForEntity("https://irs-consumer-controlplane.dev.demo.net/data/management/v2/contractagreements/contractAgreementId/negotiation",
ContractNegotiation.class);
assertNotNull(contractAgreementNegotiation);
}
Expand Down

0 comments on commit 2cd24cc

Please sign in to comment.