From 89bfe019ff5ada8d2aa05af71f18006797144104 Mon Sep 17 00:00:00 2001 From: Artem Sidorkin Date: Wed, 19 May 2021 14:27:17 +0300 Subject: [PATCH 1/2] Updated eventuate-util version. --- .../endtoendtests/CustomersAndOrdersEndToEndTest.java | 3 ++- gradle.properties | 2 +- pom.xml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/end-to-end-tests/src/test/java/io/eventuate/examples/tram/ordersandcustomers/endtoendtests/CustomersAndOrdersEndToEndTest.java b/end-to-end-tests/src/test/java/io/eventuate/examples/tram/ordersandcustomers/endtoendtests/CustomersAndOrdersEndToEndTest.java index a682daa..6d16d58 100644 --- a/end-to-end-tests/src/test/java/io/eventuate/examples/tram/ordersandcustomers/endtoendtests/CustomersAndOrdersEndToEndTest.java +++ b/end-to-end-tests/src/test/java/io/eventuate/examples/tram/ordersandcustomers/endtoendtests/CustomersAndOrdersEndToEndTest.java @@ -10,6 +10,7 @@ import io.eventuate.examples.tram.ordersandcustomers.orders.webapi.GetOrderResponse; import io.eventuate.examples.tram.ordersandcustomers.orderhistory.common.CustomerView; import io.eventuate.util.test.async.Eventually; +import io.eventuate.util.test.async.UrlTesting; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -129,7 +130,7 @@ public void testSwaggerUiUrls() throws IOException { } private void testSwaggerUiUrl(int port) throws IOException { - assertUrlStatusIsOk(String.format("http://%s:%s/swagger-ui/index.html", hostName, port)); + UrlTesting.assertUrlStatusIsOk("localhost", port, "/swagger-ui/index.html"); } private void assertUrlStatusIsOk(String url) throws IOException { diff --git a/gradle.properties b/gradle.properties index b9c9bd7..30aee70 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ eventuateMavenRepoUrl=https://dl.bintray.com/eventuateio-oss/eventuate-maven-rel springBootVersion=2.2.6.RELEASE springCloudSleuthVersion=2.2.2.RELEASE -eventuateUtilVersion=0.11.0.RELEASE +eventuateUtilVersion=0.12.0.RELEASE dockerComposePluginVersion=0.4.5 version=0.1.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index 9721aee..d40c377 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ UTF-8 1.8 2021.3.RELEASE - 0.10.0.RELEASE + 0.12.0.RELEASE 2.2.6.RELEASE 0.5.0.RELEASE 0.14.0.RELEASE From c80c4f54c6a2bee8afb4f38f1987469c1957d593 Mon Sep 17 00:00:00 2001 From: Artem Sidorkin Date: Wed, 19 May 2021 14:34:13 +0300 Subject: [PATCH 2/2] Removed unused code from tests. --- .../endtoendtests/CustomersAndOrdersEndToEndTest.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/end-to-end-tests/src/test/java/io/eventuate/examples/tram/ordersandcustomers/endtoendtests/CustomersAndOrdersEndToEndTest.java b/end-to-end-tests/src/test/java/io/eventuate/examples/tram/ordersandcustomers/endtoendtests/CustomersAndOrdersEndToEndTest.java index 6d16d58..c341e86 100644 --- a/end-to-end-tests/src/test/java/io/eventuate/examples/tram/ordersandcustomers/endtoendtests/CustomersAndOrdersEndToEndTest.java +++ b/end-to-end-tests/src/test/java/io/eventuate/examples/tram/ordersandcustomers/endtoendtests/CustomersAndOrdersEndToEndTest.java @@ -23,8 +23,6 @@ import org.springframework.web.client.RestTemplate; import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; import java.util.Arrays; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -133,12 +131,6 @@ private void testSwaggerUiUrl(int port) throws IOException { UrlTesting.assertUrlStatusIsOk("localhost", port, "/swagger-ui/index.html"); } - private void assertUrlStatusIsOk(String url) throws IOException { - HttpURLConnection connection = (HttpURLConnection)new URL(url).openConnection(); - - Assert.assertEquals(200, connection.getResponseCode()); - } - private CustomerView getCustomerView(Long customerId) { String customerHistoryUrl = baseUrlOrderHistory("customers") + "/" + customerId; ResponseEntity response = restTemplate.getForEntity(customerHistoryUrl, CustomerView.class);