From 28a3139975c8c9a8fc92eea293644c2f1b6efc33 Mon Sep 17 00:00:00 2001 From: "fabio.d.mota" Date: Tue, 18 Apr 2023 18:27:05 +0100 Subject: [PATCH] feat(Gate): Add unit test --- .../gate/controller/AddressControllerInputIT.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressControllerInputIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressControllerInputIT.kt index eeb18267c..904d93e25 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressControllerInputIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressControllerInputIT.kt @@ -50,6 +50,7 @@ import org.eclipse.tractusx.bpdm.gate.api.model.response.PageStartAfterResponse import org.eclipse.tractusx.bpdm.gate.api.model.response.ValidationResponse import org.eclipse.tractusx.bpdm.gate.api.model.response.ValidationStatus import org.eclipse.tractusx.bpdm.gate.config.SaasConfigProperties + import org.eclipse.tractusx.bpdm.gate.util.* import org.eclipse.tractusx.bpdm.gate.util.EndpointValues.SAAS_MOCK_BUSINESS_PARTNER_PATH import org.eclipse.tractusx.bpdm.gate.util.EndpointValues.SAAS_MOCK_RELATIONS_PATH @@ -352,9 +353,12 @@ internal class AddressControllerInputIT @Autowired constructor( val total = 10 val invalidEntries = 0 + + wireMockServer.stubFor( get(urlPathMatching(SAAS_MOCK_BUSINESS_PARTNER_PATH)) - .withQueryParam("externalId", absent()) + .withQueryParam("externalId", matching(".*")) + .withQueryParam("typeTechnicalKeys", matching(".*")) .willReturn( aResponse() .withHeader("Content-Type", "application/json") @@ -375,6 +379,7 @@ internal class AddressControllerInputIT @Autowired constructor( wireMockServer.stubFor( get(urlPathMatching(SAAS_MOCK_BUSINESS_PARTNER_PATH)) .withQueryParam("externalId", matching(".*")) + .withQueryParam("typeTechnicalKeys", absent()) .willReturn( aResponse() .withHeader("Content-Type", "application/json") @@ -392,10 +397,10 @@ internal class AddressControllerInputIT @Autowired constructor( ) ) - val paginationValue = PaginationStartAfterRequest(startAfter, limit) - val pageResponse = gateClient.addresses().getAddresses(paginationValue) val listExternalIds = addressesSaas.mapNotNull { it.externalId } - gateClient.addresses().getAddressesByExternalIds(paginationValue, listExternalIds) + + val paginationValue = PaginationStartAfterRequest(startAfter, limit) + val pageResponse = gateClient.addresses().getAddressesByExternalIds(paginationValue, listExternalIds) assertThat(pageResponse).isEqualTo( PageStartAfterResponse(