From eb9cd1d31846188e912efc7e35b43898686f4103 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Mon, 3 Oct 2022 17:24:21 +0300 Subject: [PATCH] change port to avoid conflict --- .../openfeign/defaulterrorhandling/client/ProductClient.java | 2 +- .../defaulterrorhandling/client/ProductClientUnitTest.java | 5 +++-- .../controller/ProductControllerUnitTest.java | 5 ++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-cloud-modules/spring-cloud-openfeign/src/main/java/com/baeldung/cloud/openfeign/defaulterrorhandling/client/ProductClient.java b/spring-cloud-modules/spring-cloud-openfeign/src/main/java/com/baeldung/cloud/openfeign/defaulterrorhandling/client/ProductClient.java index b842b948d7..2cef3d4238 100644 --- a/spring-cloud-modules/spring-cloud-openfeign/src/main/java/com/baeldung/cloud/openfeign/defaulterrorhandling/client/ProductClient.java +++ b/spring-cloud-modules/spring-cloud-openfeign/src/main/java/com/baeldung/cloud/openfeign/defaulterrorhandling/client/ProductClient.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -@FeignClient(name = "product-client", url = "http://localhost:8081/product/", configuration = FeignConfig.class) +@FeignClient(name = "product-client", url = "http://localhost:8084/product/", configuration = FeignConfig.class) public interface ProductClient { @RequestMapping(value = "{id}", method = RequestMethod.GET) diff --git a/spring-cloud-modules/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/defaulterrorhandling/client/ProductClientUnitTest.java b/spring-cloud-modules/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/defaulterrorhandling/client/ProductClientUnitTest.java index 392cb19050..4dda2bbe15 100644 --- a/spring-cloud-modules/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/defaulterrorhandling/client/ProductClientUnitTest.java +++ b/spring-cloud-modules/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/defaulterrorhandling/client/ProductClientUnitTest.java @@ -27,9 +27,10 @@ public class ProductClientUnitTest { @Before public void startWireMockServer() { - wireMockServer = new WireMockServer(8081); - configureFor("localhost", 8081); + wireMockServer = new WireMockServer(8084); + configureFor("localhost", 8084); wireMockServer.start(); + } @After diff --git a/spring-cloud-modules/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/defaulterrorhandling/controller/ProductControllerUnitTest.java b/spring-cloud-modules/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/defaulterrorhandling/controller/ProductControllerUnitTest.java index 269cd2d2d6..bfc0c3d281 100644 --- a/spring-cloud-modules/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/defaulterrorhandling/controller/ProductControllerUnitTest.java +++ b/spring-cloud-modules/spring-cloud-openfeign/src/test/java/com/baeldung/cloud/openfeign/defaulterrorhandling/controller/ProductControllerUnitTest.java @@ -20,7 +20,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - @RunWith(SpringRunner.class) @WebMvcTest(ProductController.class) @ImportAutoConfiguration({FeignAutoConfiguration.class, TestControllerAdvice.class}) @@ -37,8 +36,8 @@ public class ProductControllerUnitTest { @Before public void startWireMockServer() { - wireMockServer = new WireMockServer(8081); - configureFor("localhost", 8081); + wireMockServer = new WireMockServer(8084); + configureFor("localhost", 8084); wireMockServer.start(); }