From 820b076d50cb3901b9f2b0034db3b164c6deb310 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Wed, 8 Jun 2022 13:45:09 +0200 Subject: [PATCH 01/11] Ensure no NPE is thrown when using RestClient with Micrometer disabled (cherry picked from commit 708be0ec914304a494f6714d274dd7f746ace2fc) --- http/rest-client/pom.xml | 4 ++++ .../http/restclient/ClientBookResourceIT.java | 20 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/http/rest-client/pom.xml b/http/rest-client/pom.xml index 0153a2024..b06e6b905 100644 --- a/http/rest-client/pom.xml +++ b/http/rest-client/pom.xml @@ -23,5 +23,9 @@ io.quarkus quarkus-rest-client-jsonb + + io.quarkus + quarkus-micrometer + diff --git a/http/rest-client/src/test/java/io/quarkus/ts/http/restclient/ClientBookResourceIT.java b/http/rest-client/src/test/java/io/quarkus/ts/http/restclient/ClientBookResourceIT.java index 89f36e6cb..62915efaa 100644 --- a/http/rest-client/src/test/java/io/quarkus/ts/http/restclient/ClientBookResourceIT.java +++ b/http/rest-client/src/test/java/io/quarkus/ts/http/restclient/ClientBookResourceIT.java @@ -8,29 +8,43 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; +import io.quarkus.test.bootstrap.RestService; import io.quarkus.test.scenarios.QuarkusScenario; +import io.quarkus.test.services.QuarkusApplication; @QuarkusScenario public class ClientBookResourceIT { + @QuarkusApplication + static RestService app = new RestService(); + + @QuarkusApplication + static RestService appWithMicrometerDisabled = new RestService().withProperty("quarkus.micrometer.enabled", "false"); + @Test public void shouldGetBookFromRestClientXml() { - given().get("/client/book/xml").then().statusCode(HttpStatus.SC_OK) + app.given().get("/client/book/xml").then().statusCode(HttpStatus.SC_OK) .body(is( "Title in Xml")); } @Test public void shouldGetBookFromRestClientJson() { - given().get("/client/book/json").then().statusCode(HttpStatus.SC_OK) + app.given().get("/client/book/json").then().statusCode(HttpStatus.SC_OK) .body(is("{\"title\":\"Title in Json\"}")); } @Test @Tag("QUARKUS-1376") public void notFoundShouldNotReturnAnyResteasyImplementationDetails() { - String body = given().get("/notFound").then().statusCode(HttpStatus.SC_NOT_FOUND).extract().body().asString(); + String body = app.given().get("/notFound").then().statusCode(HttpStatus.SC_NOT_FOUND).extract().body().asString(); Assertions.assertFalse(body.contains("RESTEASY"), "Not found resource should not return any Resteasy implementation details, but was: " + body); } + + @Test + @Tag("QUARKUS-2127") + public void noNullPointerExceptionForRestClientUsageWithDisabledMicrometer() { + appWithMicrometerDisabled.given().get("/client/book/xml").then().statusCode(HttpStatus.SC_OK); + } } From 95fcdde9472c1621a4cdf63f2b2442e95f87b45c Mon Sep 17 00:00:00 2001 From: Josef Smrcka Date: Wed, 8 Jun 2022 13:09:33 +0200 Subject: [PATCH 02/11] Test ArC @All list injection Test dependency injection using ArC `@All` with `List`. See also https://github.com/quarkusio/quarkus/pull/25784. (cherry picked from commit ad4f60ef9d4f3b1687aae7a040ff745f7ba9f270) --- .../ts/spring/data/di/ListInjectionBean.java | 31 +++++++++++++++++++ .../ts/spring/data/di/ListInjectionIT.java | 25 +++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 spring/spring-data/src/main/java/io/quarkus/ts/spring/data/di/ListInjectionBean.java create mode 100644 spring/spring-data/src/test/java/io/quarkus/ts/spring/data/di/ListInjectionIT.java diff --git a/spring/spring-data/src/main/java/io/quarkus/ts/spring/data/di/ListInjectionBean.java b/spring/spring-data/src/main/java/io/quarkus/ts/spring/data/di/ListInjectionBean.java new file mode 100644 index 000000000..8a970ae4d --- /dev/null +++ b/spring/spring-data/src/main/java/io/quarkus/ts/spring/data/di/ListInjectionBean.java @@ -0,0 +1,31 @@ +package io.quarkus.ts.spring.data.di; + +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; + +import org.springframework.beans.factory.annotation.Autowired; + +import io.quarkus.arc.All; +import io.quarkus.arc.properties.IfBuildProperty; + +@ApplicationScoped +// Bean causes build error on unpatched Quarkus => enable only on demand to avoid interference with other tests. +@IfBuildProperty(name = ListInjectionBean.LIST_INJECTION_BEAN_ENABLED, stringValue = ListInjectionBean.LIST_INJECTION_BEAN_ENABLED_VALUE) +public class ListInjectionBean { + public static final String LIST_INJECTION_BEAN_ENABLED = "io.quarkus.ts.spring.data.di.ListInjectionBean.enabled"; + public static final String LIST_INJECTION_BEAN_ENABLED_VALUE = "true"; + + List constructorInjectServices; + + @Autowired + @All + List fieldInjectServices; + + ListInjectionBean(@All List constructorInjectServices) { + this.constructorInjectServices = constructorInjectServices; + } + + interface Service { + } +} diff --git a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/di/ListInjectionIT.java b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/di/ListInjectionIT.java new file mode 100644 index 000000000..62398a1e6 --- /dev/null +++ b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/di/ListInjectionIT.java @@ -0,0 +1,25 @@ +package io.quarkus.ts.spring.data.di; + +import static io.quarkus.ts.spring.data.di.ListInjectionBean.LIST_INJECTION_BEAN_ENABLED; +import static io.quarkus.ts.spring.data.di.ListInjectionBean.LIST_INJECTION_BEAN_ENABLED_VALUE; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; + +import io.quarkus.test.bootstrap.RestService; +import io.quarkus.test.scenarios.QuarkusScenario; +import io.quarkus.test.services.QuarkusApplication; + +@Tag("QUARKUS-2095") +@QuarkusScenario +public class ListInjectionIT { + + @QuarkusApplication(classes = ListInjectionBean.class) + static RestService app = new RestService().withProperty(LIST_INJECTION_BEAN_ENABLED, LIST_INJECTION_BEAN_ENABLED_VALUE); + + @Test + public void appStartsWhenUsingFieldInjectionWithAllAnnotationOnList() { + Assertions.assertTrue(app.isRunning()); + } +} From 1ad547de25ff289619404a02a5123a5d0cfb7de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vav=C5=99=C3=ADk?= Date: Thu, 9 Jun 2022 19:43:02 +0200 Subject: [PATCH 03/11] Fix OpenShiftGraphQLTelemetryIT - filter Jaeger traces by operation name Currently traces are filtered by "operationName" which is not valid filter parameter and operations are not filtered by this. That causes problem in OpenShift where there are other calls (other operations with different names, e.g. "HTTP GET" - probably probe check). Problem can be easily reproduced locally on GraphQLTelemetryIT when you call GET to '/' couple of times, which leads to test failure. (cherry picked from commit 815c398902327a00a50cb319df27dcd4d36d8d28) --- .../quarkus/ts/http/graphql/telemetry/GraphQLTelemetryIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/graphql-telemetry/src/test/java/io/quarkus/ts/http/graphql/telemetry/GraphQLTelemetryIT.java b/http/graphql-telemetry/src/test/java/io/quarkus/ts/http/graphql/telemetry/GraphQLTelemetryIT.java index 2260ac605..a916366bf 100644 --- a/http/graphql-telemetry/src/test/java/io/quarkus/ts/http/graphql/telemetry/GraphQLTelemetryIT.java +++ b/http/graphql-telemetry/src/test/java/io/quarkus/ts/http/graphql/telemetry/GraphQLTelemetryIT.java @@ -41,7 +41,7 @@ void verifyTelemetry() { await().atMost(1, TimeUnit.MINUTES).pollInterval(Duration.ofSeconds(10)).untilAsserted(() -> { String operation = "graphql"; Response traces = given().when() - .queryParam("operationName", operation) + .queryParam("operation", operation) .queryParam("lookback", "1h") .queryParam("limit", 10) .queryParam("service", "graphql-telemetry") From 6b0f53137b25e66ef7ea2c1a6358478a994e48f3 Mon Sep 17 00:00:00 2001 From: Josef Smrcka Date: Wed, 8 Jun 2022 16:31:07 +0200 Subject: [PATCH 04/11] Rename test classes and tests in jaxrs* modules (cherry picked from commit b5ad765eebe437a0ad8354d0940bd57fef60de47) --- ...rceIT.java => OpenShiftRESTEasyReactiveMultipartIT.java} | 2 +- ...ourceIT.java => RESTEasyReactiveMultipartCharsetIT.java} | 4 ++-- ...partResourceIT.java => RESTEasyReactiveMultipartIT.java} | 6 +++--- ...artResourceIT.java => OpenShiftRESTEasyMultipartIT.java} | 2 +- ...ipartResourceIT.java => RESTEasyMultipartCharsetIT.java} | 4 ++-- .../{MultipartResourceIT.java => RESTEasyMultipartIT.java} | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) rename http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/{OpenShiftMultipartResourceIT.java => OpenShiftRESTEasyReactiveMultipartIT.java} (57%) rename http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/{AsciiMultipartResourceIT.java => RESTEasyReactiveMultipartCharsetIT.java} (93%) rename http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/{MultipartResourceIT.java => RESTEasyReactiveMultipartIT.java} (93%) rename http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/{OpenShiftMultipartResourceIT.java => OpenShiftRESTEasyMultipartIT.java} (60%) rename http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/{AsciiMultipartResourceIT.java => RESTEasyMultipartCharsetIT.java} (93%) rename http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/{MultipartResourceIT.java => RESTEasyMultipartIT.java} (95%) diff --git a/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/OpenShiftMultipartResourceIT.java b/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/OpenShiftRESTEasyReactiveMultipartIT.java similarity index 57% rename from http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/OpenShiftMultipartResourceIT.java rename to http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/OpenShiftRESTEasyReactiveMultipartIT.java index 408e13984..8617654cf 100644 --- a/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/OpenShiftMultipartResourceIT.java +++ b/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/OpenShiftRESTEasyReactiveMultipartIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftMultipartResourceIT extends MultipartResourceIT { +public class OpenShiftRESTEasyReactiveMultipartIT extends RESTEasyReactiveMultipartIT { } diff --git a/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/AsciiMultipartResourceIT.java b/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/RESTEasyReactiveMultipartCharsetIT.java similarity index 93% rename from http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/AsciiMultipartResourceIT.java rename to http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/RESTEasyReactiveMultipartCharsetIT.java index 5780d9373..89a533622 100644 --- a/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/AsciiMultipartResourceIT.java +++ b/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/RESTEasyReactiveMultipartCharsetIT.java @@ -17,7 +17,7 @@ @Tag("QUARKUS-1075") @QuarkusScenario -public class AsciiMultipartResourceIT { +public class RESTEasyReactiveMultipartCharsetIT { public static final String TEXT_WITH_DIACRITICS = "Přikrášlený žloťoučký kůň úpěl ďábelské ódy."; private static final String EXPECTED_ASCII_TEXT = new String(TEXT_WITH_DIACRITICS.getBytes(StandardCharsets.UTF_8), @@ -27,7 +27,7 @@ public class AsciiMultipartResourceIT { static RestService app = new RestService().withProperties("us-asscii.properties"); @Test - public void testMultipartText() { + public void textInMultipartRequestEncodedWithDefaultCharset() { MultiPartSpecification multiPartSpecification = new MultiPartSpecBuilder(TEXT_WITH_DIACRITICS) .controlName("text") .header("Content-Type", "text/plain") diff --git a/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/MultipartResourceIT.java b/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/RESTEasyReactiveMultipartIT.java similarity index 93% rename from http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/MultipartResourceIT.java rename to http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/RESTEasyReactiveMultipartIT.java index e3722edb8..47a50ead7 100644 --- a/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/MultipartResourceIT.java +++ b/http/jaxrs-reactive/src/test/java/io/quarkus/ts/http/jaxrs/reactive/RESTEasyReactiveMultipartIT.java @@ -25,7 +25,7 @@ @Tag("QUARKUS-1075") @QuarkusScenario -public class MultipartResourceIT { +public class RESTEasyReactiveMultipartIT { private static final String IMAGE_FILE_NAME = "/quarkus.png"; private static final String TEXT_WITH_DIACRITICS = "Přikrášlený žloťoučký kůň úpěl ďábelské ódy."; @@ -35,8 +35,8 @@ public class MultipartResourceIT { @BeforeAll public static void beforeAll() throws IOException { - imageFile = new File(MultipartResourceIT.class.getResource(IMAGE_FILE_NAME).getFile()); - imageBytes = IOUtils.toByteArray(MultipartResourceIT.class.getResourceAsStream(IMAGE_FILE_NAME)); + imageFile = new File(RESTEasyReactiveMultipartIT.class.getResource(IMAGE_FILE_NAME).getFile()); + imageBytes = IOUtils.toByteArray(RESTEasyReactiveMultipartIT.class.getResourceAsStream(IMAGE_FILE_NAME)); new Random().nextBytes(randomBytes); } diff --git a/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/OpenShiftMultipartResourceIT.java b/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/OpenShiftRESTEasyMultipartIT.java similarity index 60% rename from http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/OpenShiftMultipartResourceIT.java rename to http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/OpenShiftRESTEasyMultipartIT.java index c6b076944..2d220ca29 100644 --- a/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/OpenShiftMultipartResourceIT.java +++ b/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/OpenShiftRESTEasyMultipartIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftMultipartResourceIT extends MultipartResourceIT { +public class OpenShiftRESTEasyMultipartIT extends RESTEasyMultipartIT { } diff --git a/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/AsciiMultipartResourceIT.java b/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/RESTEasyMultipartCharsetIT.java similarity index 93% rename from http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/AsciiMultipartResourceIT.java rename to http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/RESTEasyMultipartCharsetIT.java index 09c80cb1e..7d03947c4 100644 --- a/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/AsciiMultipartResourceIT.java +++ b/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/RESTEasyMultipartCharsetIT.java @@ -15,7 +15,7 @@ import io.restassured.specification.MultiPartSpecification; @QuarkusScenario -public class AsciiMultipartResourceIT { +public class RESTEasyMultipartCharsetIT { public static final String TEXT_WITH_DIACRITICS = "Přikrášlený žloťoučký kůň úpěl ďábelské ódy."; private static final String EXPECTED_ASCII_TEXT = new String(TEXT_WITH_DIACRITICS.getBytes(StandardCharsets.UTF_8), @@ -25,7 +25,7 @@ public class AsciiMultipartResourceIT { static RestService app = new RestService().withProperties("us-asscii.properties"); @Test - public void testMultipartText() { + public void textInMultipartRequestEncodedWithDefaultCharset() { MultiPartSpecification multiPartSpecification = new MultiPartSpecBuilder(TEXT_WITH_DIACRITICS) .controlName("text") .header("Content-Type", "text/plain") diff --git a/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/MultipartResourceIT.java b/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/RESTEasyMultipartIT.java similarity index 95% rename from http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/MultipartResourceIT.java rename to http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/RESTEasyMultipartIT.java index 3a16dab15..a67c24089 100644 --- a/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/MultipartResourceIT.java +++ b/http/jaxrs/src/test/java/io/quarkus/ts/http/jaxrs/RESTEasyMultipartIT.java @@ -23,7 +23,7 @@ import io.restassured.specification.MultiPartSpecification; @QuarkusScenario -public class MultipartResourceIT { +public class RESTEasyMultipartIT { private static final String IMAGE_FILE_NAME = "/quarkus.png"; private static final String TEXT_WITH_DIACRITICS = "Přikrášlený žloťoučký kůň úpěl ďábelské ódy."; @@ -33,8 +33,8 @@ public class MultipartResourceIT { @BeforeAll public static void beforeAll() throws IOException { - imageFile = new File(MultipartResourceIT.class.getResource(IMAGE_FILE_NAME).getFile()); - imageBytes = IOUtils.toByteArray(MultipartResourceIT.class.getResourceAsStream(IMAGE_FILE_NAME)); + imageFile = new File(RESTEasyMultipartIT.class.getResource(IMAGE_FILE_NAME).getFile()); + imageBytes = IOUtils.toByteArray(RESTEasyMultipartIT.class.getResourceAsStream(IMAGE_FILE_NAME)); new Random().nextBytes(randomBytes); } From 5d891ec47ee4fdeed85f7be021d6d0dc399b8eee Mon Sep 17 00:00:00 2001 From: Josef Smrcka Date: Thu, 9 Jun 2022 10:48:16 +0200 Subject: [PATCH 05/11] Rename test classes and tests in mongodb* modules (cherry picked from commit fb187b9e863af79be06e9803034df9c24757665d) --- ...ava => AbstractMongoClientReactiveIT.java} | 6 ++-- ...goDbIT.java => MongoClientReactiveIT.java} | 2 +- ...va => OpenShiftMongoClientReactiveIT.java} | 2 +- .../{MongoDbIT.java => MongoClientIT.java} | 33 ++++++++++++++----- ...oDbIT.java => OpenShiftMongoClientIT.java} | 2 +- 5 files changed, 30 insertions(+), 15 deletions(-) rename nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/{AbstractMongoDbIT.java => AbstractMongoClientReactiveIT.java} (96%) rename nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/{MongoDbIT.java => MongoClientReactiveIT.java} (90%) rename nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/{OpenShiftMongoDbIT.java => OpenShiftMongoClientReactiveIT.java} (89%) rename nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/{MongoDbIT.java => MongoClientIT.java} (86%) rename nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/{OpenShiftMongoDbIT.java => OpenShiftMongoClientIT.java} (65%) diff --git a/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/AbstractMongoDbIT.java b/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/AbstractMongoClientReactiveIT.java similarity index 96% rename from nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/AbstractMongoDbIT.java rename to nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/AbstractMongoClientReactiveIT.java index 17c445994..27bd73662 100644 --- a/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/AbstractMongoDbIT.java +++ b/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/AbstractMongoClientReactiveIT.java @@ -18,10 +18,10 @@ import io.vertx.mutiny.ext.web.client.HttpRequest; import io.vertx.mutiny.ext.web.client.HttpResponse; -public abstract class AbstractMongoDbIT { +public abstract class AbstractMongoClientReactiveIT { @ParameterizedTest @ValueSource(strings = { "/reactive_fruits" }) - public void fruitsEndpoints(String path) { + public void insertAndGetSimpleEntity(String path) { final Fruit fruit1 = new Fruit("fruit1", "fruit description 1"); final Fruit fruit2 = new Fruit("fruit2", "fruit description 2"); @@ -40,7 +40,7 @@ public void fruitsEndpoints(String path) { @ParameterizedTest @ValueSource(strings = { "/reactive_fruit_baskets" }) - public void fruitBasketsEndpoints(String path) { + public void insertAndGetCompositeEntity(String path) { final Fruit fruit1 = new Fruit("fruit1", "fruit description 1"); final Fruit fruit2 = new Fruit("fruit2", "fruit description 2"); final FruitBasket fruitBasket1 = new FruitBasket("null", null); diff --git a/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/MongoDbIT.java b/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/MongoClientReactiveIT.java similarity index 90% rename from nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/MongoDbIT.java rename to nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/MongoClientReactiveIT.java index a9d4f6f69..ea3726f61 100644 --- a/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/MongoDbIT.java +++ b/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/MongoClientReactiveIT.java @@ -7,7 +7,7 @@ import io.quarkus.test.services.QuarkusApplication; @QuarkusScenario -public class MongoDbIT extends AbstractMongoDbIT { +public class MongoClientReactiveIT extends AbstractMongoClientReactiveIT { @Container(image = "${mongodb.image}", port = 27017, expectedLog = "Waiting for connections") static MongoDbService database = new MongoDbService(); diff --git a/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/OpenShiftMongoDbIT.java b/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/OpenShiftMongoClientReactiveIT.java similarity index 89% rename from nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/OpenShiftMongoDbIT.java rename to nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/OpenShiftMongoClientReactiveIT.java index c408c4a41..14252ed32 100644 --- a/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/OpenShiftMongoDbIT.java +++ b/nosql-db/mongodb-reactive/src/test/java/io/quarkus/ts/nosqldb/mongodb/reactive/OpenShiftMongoClientReactiveIT.java @@ -7,7 +7,7 @@ import io.quarkus.test.services.QuarkusApplication; @OpenShiftScenario -public class OpenShiftMongoDbIT extends AbstractMongoDbIT { +public class OpenShiftMongoClientReactiveIT extends AbstractMongoClientReactiveIT { @Container(image = "${mongodb.image}", port = 27017, expectedLog = "Waiting for connections") static MongoDbService database = new MongoDbService(); diff --git a/nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/MongoDbIT.java b/nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/MongoClientIT.java similarity index 86% rename from nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/MongoDbIT.java rename to nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/MongoClientIT.java index a595447bd..6bb0f61ef 100644 --- a/nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/MongoDbIT.java +++ b/nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/MongoClientIT.java @@ -5,8 +5,7 @@ import java.util.List; import org.apache.http.HttpStatus; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; +import org.junit.jupiter.api.Test; import io.quarkus.test.bootstrap.MongoDbService; import io.quarkus.test.bootstrap.RestService; @@ -18,7 +17,7 @@ import io.restassured.path.json.JsonPath; @QuarkusScenario -public class MongoDbIT { +public class MongoClientIT { @Container(image = "${mongodb.image}", port = 27017, expectedLog = "Waiting for connections") static MongoDbService database = new MongoDbService(); @@ -27,9 +26,17 @@ public class MongoDbIT { static RestService app = new RestService() .withProperty("quarkus.mongodb.connection-string", database::getJdbcUrl); - @ParameterizedTest - @ValueSource(strings = { "/fruits", "/codec_fruits" }) - public void fruitsEndpoints(String path) { + @Test + public void insertAndGetSimpleEntity() { + insertAndGetSimpleEntity("/fruits"); + } + + @Test + public void insertAndGetSimpleEntityWithBsonCodec() { + insertAndGetSimpleEntity("/codec_fruits"); + } + + public void insertAndGetSimpleEntity(String path) { final Fruit fruit1 = new Fruit("fruit1", "fruit description 1"); final Fruit fruit2 = new Fruit("fruit2", "fruit description 2"); @@ -49,9 +56,17 @@ public void fruitsEndpoints(String path) { assertThat(fruits2).isEqualTo(fruits1); } - @ParameterizedTest - @ValueSource(strings = { "/fruit_baskets", "/codec_fruit_baskets" }) - public void fruitBasketsEndpoints(String path) { + @Test + public void insertAndGetCompositeEntity() { + insertAndGetCompositeEntity("/fruit_baskets"); + } + + @Test + public void insertAndGetCompositeEntityWithBsonCodec() { + insertAndGetCompositeEntity("/codec_fruit_baskets"); + } + + public void insertAndGetCompositeEntity(String path) { final Fruit fruit1 = new Fruit("fruit1", "fruit description 1"); final Fruit fruit2 = new Fruit("fruit2", "fruit description 2"); final FruitBasket fruitBasket1 = new FruitBasket("null", null); diff --git a/nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/OpenShiftMongoDbIT.java b/nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/OpenShiftMongoClientIT.java similarity index 65% rename from nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/OpenShiftMongoDbIT.java rename to nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/OpenShiftMongoClientIT.java index 678a7cb73..aed1d3e2a 100644 --- a/nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/OpenShiftMongoDbIT.java +++ b/nosql-db/mongodb/src/test/java/io/quarkus/ts/nosqldb/mongodb/OpenShiftMongoClientIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftMongoDbIT extends MongoDbIT { +public class OpenShiftMongoClientIT extends MongoClientIT { } From ceab557e9869349dcc871cab21c4421130d83b75 Mon Sep 17 00:00:00 2001 From: Josef Smrcka Date: Thu, 9 Jun 2022 10:57:48 +0200 Subject: [PATCH 06/11] Rename test classes and tests in http-minimum* modules (cherry picked from commit 387a090da1f49c522e39dfb3406082d4be17326e) --- ...ttpCustomHeadersIT.java => HttpCustomHeadersReactiveIT.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename http/http-minimum-reactive/src/test/java/io/quarkus/ts/http/minimum/reactive/{HttpCustomHeadersIT.java => HttpCustomHeadersReactiveIT.java} (96%) diff --git a/http/http-minimum-reactive/src/test/java/io/quarkus/ts/http/minimum/reactive/HttpCustomHeadersIT.java b/http/http-minimum-reactive/src/test/java/io/quarkus/ts/http/minimum/reactive/HttpCustomHeadersReactiveIT.java similarity index 96% rename from http/http-minimum-reactive/src/test/java/io/quarkus/ts/http/minimum/reactive/HttpCustomHeadersIT.java rename to http/http-minimum-reactive/src/test/java/io/quarkus/ts/http/minimum/reactive/HttpCustomHeadersReactiveIT.java index 93bd675ce..0e01f873f 100644 --- a/http/http-minimum-reactive/src/test/java/io/quarkus/ts/http/minimum/reactive/HttpCustomHeadersIT.java +++ b/http/http-minimum-reactive/src/test/java/io/quarkus/ts/http/minimum/reactive/HttpCustomHeadersReactiveIT.java @@ -13,7 +13,7 @@ import io.quarkus.test.scenarios.QuarkusScenario; @QuarkusScenario -public class HttpCustomHeadersIT { +public class HttpCustomHeadersReactiveIT { @Tag("QUARKUS-1574") @Test From 3230ab3ec7b28d2af9c0d9b7cac52e6343653dff Mon Sep 17 00:00:00 2001 From: Josef Smrcka Date: Thu, 9 Jun 2022 11:36:59 +0200 Subject: [PATCH 07/11] Rename test classes and tests in cache* modules (cherry picked from commit c1b87bdfe6b222bd5187d0b964737e5de7ffdf43) --- .../{ServiceWithCacheResourceIT.java => CaffeineCacheIT.java} | 2 +- ...ceWithCacheResourceIT.java => OpenShiftCaffeineCacheIT.java} | 2 +- ...viceWithCacheResourceIT.java => OpenShiftSpringCacheIT.java} | 2 +- .../{ServiceWithCacheResourceIT.java => SpringCacheIT.java} | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/{ServiceWithCacheResourceIT.java => CaffeineCacheIT.java} (99%) rename cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/{OpenShiftServiceWithCacheResourceIT.java => OpenShiftCaffeineCacheIT.java} (59%) rename cache/spring/src/test/java/io/quarkus/ts/cache/spring/{OpenShiftServiceWithCacheResourceIT.java => OpenShiftSpringCacheIT.java} (56%) rename cache/spring/src/test/java/io/quarkus/ts/cache/spring/{ServiceWithCacheResourceIT.java => SpringCacheIT.java} (99%) diff --git a/cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/ServiceWithCacheResourceIT.java b/cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/CaffeineCacheIT.java similarity index 99% rename from cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/ServiceWithCacheResourceIT.java rename to cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/CaffeineCacheIT.java index 3c34efc66..33b9b368d 100644 --- a/cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/ServiceWithCacheResourceIT.java +++ b/cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/CaffeineCacheIT.java @@ -13,7 +13,7 @@ import io.quarkus.test.scenarios.QuarkusScenario; @QuarkusScenario -public class ServiceWithCacheResourceIT { +public class CaffeineCacheIT { private static final String SERVICE_APPLICATION_SCOPE_PATH = "/services/" + APPLICATION_SCOPE_SERVICE_PATH; private static final String SERVICE_REQUEST_SCOPE_PATH = "/services/" + REQUEST_SCOPE_SERVICE_PATH; diff --git a/cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/OpenShiftServiceWithCacheResourceIT.java b/cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/OpenShiftCaffeineCacheIT.java similarity index 59% rename from cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/OpenShiftServiceWithCacheResourceIT.java rename to cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/OpenShiftCaffeineCacheIT.java index 80fce5889..13245f976 100644 --- a/cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/OpenShiftServiceWithCacheResourceIT.java +++ b/cache/caffeine/src/test/java/io/quarkus/ts/cache/caffeine/cache/caffeine/OpenShiftCaffeineCacheIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftServiceWithCacheResourceIT extends ServiceWithCacheResourceIT { +public class OpenShiftCaffeineCacheIT extends CaffeineCacheIT { } diff --git a/cache/spring/src/test/java/io/quarkus/ts/cache/spring/OpenShiftServiceWithCacheResourceIT.java b/cache/spring/src/test/java/io/quarkus/ts/cache/spring/OpenShiftSpringCacheIT.java similarity index 56% rename from cache/spring/src/test/java/io/quarkus/ts/cache/spring/OpenShiftServiceWithCacheResourceIT.java rename to cache/spring/src/test/java/io/quarkus/ts/cache/spring/OpenShiftSpringCacheIT.java index 57376eb62..311d4dc0a 100644 --- a/cache/spring/src/test/java/io/quarkus/ts/cache/spring/OpenShiftServiceWithCacheResourceIT.java +++ b/cache/spring/src/test/java/io/quarkus/ts/cache/spring/OpenShiftSpringCacheIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftServiceWithCacheResourceIT extends ServiceWithCacheResourceIT { +public class OpenShiftSpringCacheIT extends SpringCacheIT { } diff --git a/cache/spring/src/test/java/io/quarkus/ts/cache/spring/ServiceWithCacheResourceIT.java b/cache/spring/src/test/java/io/quarkus/ts/cache/spring/SpringCacheIT.java similarity index 99% rename from cache/spring/src/test/java/io/quarkus/ts/cache/spring/ServiceWithCacheResourceIT.java rename to cache/spring/src/test/java/io/quarkus/ts/cache/spring/SpringCacheIT.java index 4b3d82a8d..6cbaa0420 100644 --- a/cache/spring/src/test/java/io/quarkus/ts/cache/spring/ServiceWithCacheResourceIT.java +++ b/cache/spring/src/test/java/io/quarkus/ts/cache/spring/SpringCacheIT.java @@ -13,7 +13,7 @@ import io.quarkus.test.scenarios.QuarkusScenario; @QuarkusScenario -public class ServiceWithCacheResourceIT { +public class SpringCacheIT { private static final String SERVICE_APPLICATION_SCOPE_PATH = "/services/" + APPLICATION_SCOPE_SERVICE_PATH; private static final String SERVICE_REQUEST_SCOPE_PATH = "/services/" + REQUEST_SCOPE_SERVICE_PATH; From b734d2b9adf6fe85f34843f0ea70681a3f7032a9 Mon Sep 17 00:00:00 2001 From: Josef Smrcka Date: Thu, 9 Jun 2022 12:09:13 +0200 Subject: [PATCH 08/11] Rename test classes and tests in security-keycloak-authz* modules (cherry picked from commit b88a1ccbf326180fab2ac8a9188280d4a8ca8f28) --- ...aseAuthzSecurityIT.java => BaseAuthzSecurityReactiveIT.java} | 2 +- ...uthzSecurityIT.java => KeycloakAuthzSecurityReactiveIT.java} | 2 +- ...curityIT.java => OpenShiftRhSsoAuthzSecurityReactiveIT.java} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/{BaseAuthzSecurityIT.java => BaseAuthzSecurityReactiveIT.java} (99%) rename security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/{KeycloakAuthzSecurityIT.java => KeycloakAuthzSecurityReactiveIT.java} (93%) rename security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/{OpenShiftRhSsoAuthzSecurityIT.java => OpenShiftRhSsoAuthzSecurityReactiveIT.java} (93%) diff --git a/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/BaseAuthzSecurityIT.java b/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/BaseAuthzSecurityReactiveIT.java similarity index 99% rename from security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/BaseAuthzSecurityIT.java rename to security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/BaseAuthzSecurityReactiveIT.java index c58012071..64f2f939b 100644 --- a/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/BaseAuthzSecurityIT.java +++ b/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/BaseAuthzSecurityReactiveIT.java @@ -19,7 +19,7 @@ import io.vertx.mutiny.ext.web.client.HttpRequest; import io.vertx.mutiny.ext.web.client.HttpResponse; -public abstract class BaseAuthzSecurityIT { +public abstract class BaseAuthzSecurityReactiveIT { static final String NORMAL_USER = "test-normal-user"; static final String ADMIN_USER = "test-admin-user"; diff --git a/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/KeycloakAuthzSecurityIT.java b/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/KeycloakAuthzSecurityReactiveIT.java similarity index 93% rename from security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/KeycloakAuthzSecurityIT.java rename to security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/KeycloakAuthzSecurityReactiveIT.java index 733af3908..1423ef0df 100644 --- a/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/KeycloakAuthzSecurityIT.java +++ b/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/KeycloakAuthzSecurityReactiveIT.java @@ -7,7 +7,7 @@ import io.quarkus.test.services.QuarkusApplication; @QuarkusScenario -public class KeycloakAuthzSecurityIT extends BaseAuthzSecurityIT { +public class KeycloakAuthzSecurityReactiveIT extends BaseAuthzSecurityReactiveIT { static final int KEYCLOAK_PORT = 8080; diff --git a/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/OpenShiftRhSsoAuthzSecurityIT.java b/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/OpenShiftRhSsoAuthzSecurityReactiveIT.java similarity index 93% rename from security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/OpenShiftRhSsoAuthzSecurityIT.java rename to security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/OpenShiftRhSsoAuthzSecurityReactiveIT.java index 3e30fd831..441980fb0 100644 --- a/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/OpenShiftRhSsoAuthzSecurityIT.java +++ b/security/keycloak-authz-reactive/src/test/java/io/quarkus/ts/security/keycloak/authz/reactive/OpenShiftRhSsoAuthzSecurityReactiveIT.java @@ -10,7 +10,7 @@ @OpenShiftScenario @EnabledIfSystemProperty(named = "ts.redhat.registry.enabled", matches = "true") -public class OpenShiftRhSsoAuthzSecurityIT extends BaseAuthzSecurityIT { +public class OpenShiftRhSsoAuthzSecurityReactiveIT extends BaseAuthzSecurityReactiveIT { static final int KEYCLOAK_PORT = 8080; From 15371c1b5649e01ad6328f051a1c481bef68afc6 Mon Sep 17 00:00:00 2001 From: Josef Smrcka Date: Thu, 9 Jun 2022 12:42:56 +0200 Subject: [PATCH 09/11] Rename test classes in security-keycloak-oidc-client-extended module (cherry picked from commit d2d335f6ddf01dea6fb739e1b9d7e4a193288940) --- .../extended/restclient/{BaseIT.java => BaseOidcIT.java} | 2 +- ...stClientInPingPongResourcesIT.java => OidcRestClientIT.java} | 2 +- .../restclient/{OpenApiIT.java => OpenApiStoreSchemaIT.java} | 2 +- ...nPingPongResourcesIT.java => OpenShiftOidcRestClientIT.java} | 2 +- .../{SecuredResourceIT.java => SecurityClaimsIT.java} | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/{BaseIT.java => BaseOidcIT.java} (97%) rename security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/{RestClientInPingPongResourcesIT.java => OidcRestClientIT.java} (98%) rename security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/{OpenApiIT.java => OpenApiStoreSchemaIT.java} (98%) rename security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/{OpenShiftRestClientInPingPongResourcesIT.java => OpenShiftOidcRestClientIT.java} (60%) rename security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/{SecuredResourceIT.java => SecurityClaimsIT.java} (96%) diff --git a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/BaseIT.java b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/BaseOidcIT.java similarity index 97% rename from security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/BaseIT.java rename to security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/BaseOidcIT.java index 9dfe537a4..d0b203517 100644 --- a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/BaseIT.java +++ b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/BaseOidcIT.java @@ -8,7 +8,7 @@ import io.quarkus.test.services.Container; import io.quarkus.test.services.QuarkusApplication; -public abstract class BaseIT { +public abstract class BaseOidcIT { static final String USER = "test-user"; static final int KEYCLOAK_PORT = 8080; diff --git a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/RestClientInPingPongResourcesIT.java b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OidcRestClientIT.java similarity index 98% rename from security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/RestClientInPingPongResourcesIT.java rename to security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OidcRestClientIT.java index 5d89f2d6f..2925efd04 100644 --- a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/RestClientInPingPongResourcesIT.java +++ b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OidcRestClientIT.java @@ -15,7 +15,7 @@ import io.restassured.http.ContentType; @QuarkusScenario -public class RestClientInPingPongResourcesIT extends BaseIT { +public class OidcRestClientIT extends BaseOidcIT { static final String PING_ENDPOINT = "/%s-ping"; static final String PONG_ENDPOINT = "/%s-pong"; diff --git a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenApiIT.java b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenApiStoreSchemaIT.java similarity index 98% rename from security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenApiIT.java rename to security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenApiStoreSchemaIT.java index 4043fc9fb..3b61a47f9 100644 --- a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenApiIT.java +++ b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenApiStoreSchemaIT.java @@ -22,7 +22,7 @@ import io.vertx.core.json.JsonObject; @QuarkusScenario -public class OpenApiIT extends BaseIT { +public class OpenApiStoreSchemaIT extends BaseOidcIT { private static String directory = "target/generated/jax-rs/"; private static final String OPEN_API_DOT = "openapi."; diff --git a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenShiftRestClientInPingPongResourcesIT.java b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenShiftOidcRestClientIT.java similarity index 60% rename from security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenShiftRestClientInPingPongResourcesIT.java rename to security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenShiftOidcRestClientIT.java index 9d4b5b568..6645930f2 100644 --- a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenShiftRestClientInPingPongResourcesIT.java +++ b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/OpenShiftOidcRestClientIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftRestClientInPingPongResourcesIT extends RestClientInPingPongResourcesIT { +public class OpenShiftOidcRestClientIT extends OidcRestClientIT { } diff --git a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/SecuredResourceIT.java b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/SecurityClaimsIT.java similarity index 96% rename from security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/SecuredResourceIT.java rename to security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/SecurityClaimsIT.java index bcc2546e1..f10f27393 100644 --- a/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/SecuredResourceIT.java +++ b/security/keycloak-oidc-client-extended/src/test/java/io/quarkus/ts/security/keycloak/oidcclient/extended/restclient/SecurityClaimsIT.java @@ -9,7 +9,7 @@ import io.quarkus.test.scenarios.QuarkusScenario; @QuarkusScenario -public class SecuredResourceIT extends BaseIT { +public class SecurityClaimsIT extends BaseOidcIT { private static final String SECURED_PATH = "/secured"; private static final String CLAIMS_FROM_BEANS_PATH = "/getClaimsFromBeans"; From 6ce6bf1003a2fcd7af4218f0451233ef1082978d Mon Sep 17 00:00:00 2001 From: Josef Smrcka Date: Thu, 9 Jun 2022 16:34:50 +0200 Subject: [PATCH 10/11] Rename and rearrange classes in spring-web module (cherry picked from commit 5a198020bf9aaad9b4933bbe63d60703c85be630) --- .../spring/web/reactive/MariaDBConstants.java | 9 +++++ .../ts/spring/web/reactive/MariaDBUtils.java | 6 ---- .../AbstractSpringWebQuteIT.java} | 4 +-- ...ceIT.java => AbstractSpringWebRestIT.java} | 24 ++----------- ...eIT.java => OpenShiftSpringWebQuteIT.java} | 11 +++--- ...eIT.java => OpenShiftSpringWebRestIT.java} | 11 +++--- .../{HomePageIT.java => SpringWebQuteIT.java} | 10 +++--- .../reactive/boostrap/SpringWebRestIT.java | 29 +++++++++++++++ ...T.java => AbstractSpringWebOpenApiIT.java} | 29 +++------------ ....java => OpenShiftSpringWebOpenApiIT.java} | 14 +++++--- .../reactive/openapi/SpringWebOpenApiIT.java | 35 +++++++++++++++++++ 11 files changed, 108 insertions(+), 74 deletions(-) create mode 100644 spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/MariaDBConstants.java delete mode 100644 spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/MariaDBUtils.java rename spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/{AbstractDbIT.java => boostrap/AbstractSpringWebQuteIT.java} (85%) rename spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/{BookResourceIT.java => AbstractSpringWebRestIT.java} (82%) rename spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/{OpenShiftHomePageIT.java => OpenShiftSpringWebQuteIT.java} (67%) rename spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/{OpenShiftBookResourceIT.java => OpenShiftSpringWebRestIT.java} (71%) rename spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/{HomePageIT.java => SpringWebQuteIT.java} (68%) create mode 100644 spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/SpringWebRestIT.java rename spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/{OpenApiIT.java => AbstractSpringWebOpenApiIT.java} (60%) rename spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/{OpenShiftOpenApiIT.java => OpenShiftSpringWebOpenApiIT.java} (63%) create mode 100644 spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/SpringWebOpenApiIT.java diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/MariaDBConstants.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/MariaDBConstants.java new file mode 100644 index 000000000..708079745 --- /dev/null +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/MariaDBConstants.java @@ -0,0 +1,9 @@ +package io.quarkus.ts.spring.web.reactive; + +public class MariaDBConstants { + public static final int PORT = 3306; + public static final String START_LOG_10 = "socket: '/run/mysqld/mysqld.sock' port: " + PORT; + public static final String START_LOG_105 = "Only MySQL server logs after this point"; + public static final String IMAGE_10 = "${mariadb.10.image}"; + public static final String IMAGE_105 = "${mariadb.105.image}"; +} diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/MariaDBUtils.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/MariaDBUtils.java deleted file mode 100644 index 7a480ce0a..000000000 --- a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/MariaDBUtils.java +++ /dev/null @@ -1,6 +0,0 @@ -package io.quarkus.ts.spring.web.reactive; - -public class MariaDBUtils { - public static final int PORT = 3306; - public static final String START_LOG = "socket: '/run/mysqld/mysqld.sock' port: " + PORT; -} diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/AbstractDbIT.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/AbstractSpringWebQuteIT.java similarity index 85% rename from spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/AbstractDbIT.java rename to spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/AbstractSpringWebQuteIT.java index bcde4da63..c99ea12a6 100644 --- a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/AbstractDbIT.java +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/AbstractSpringWebQuteIT.java @@ -1,4 +1,4 @@ -package io.quarkus.ts.spring.web.reactive; +package io.quarkus.ts.spring.web.reactive.boostrap; import org.hamcrest.CoreMatchers; import org.junit.jupiter.api.Test; @@ -7,7 +7,7 @@ import io.quarkus.test.bootstrap.RestService; import io.restassured.http.ContentType; -public abstract class AbstractDbIT { +public abstract class AbstractSpringWebQuteIT { private static final String APP_NAME = "Bootstrap Spring Boot"; diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/BookResourceIT.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/AbstractSpringWebRestIT.java similarity index 82% rename from spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/BookResourceIT.java rename to spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/AbstractSpringWebRestIT.java index 1979b5eb9..cf536b49b 100644 --- a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/BookResourceIT.java +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/AbstractSpringWebRestIT.java @@ -11,29 +11,14 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import io.quarkus.test.bootstrap.MariaDbService; import io.quarkus.test.bootstrap.RestService; -import io.quarkus.test.scenarios.QuarkusScenario; -import io.quarkus.test.services.Container; -import io.quarkus.test.services.QuarkusApplication; -import io.quarkus.ts.spring.web.reactive.AbstractDbIT; -import io.quarkus.ts.spring.web.reactive.MariaDBUtils; import io.quarkus.ts.spring.web.reactive.boostrap.persistence.model.Book; import io.restassured.response.Response; -@QuarkusScenario -public class BookResourceIT extends AbstractDbIT { - +public abstract class AbstractSpringWebRestIT { private static final String API_ROOT = "/api/books"; - @Container(image = "${mariadb.10.image}", port = MariaDBUtils.PORT, expectedLog = MariaDBUtils.START_LOG) - static final MariaDbService database = new MariaDbService(); - - @QuarkusApplication - private static final RestService app = new RestService() - .withProperty("quarkus.datasource.username", database.getUser()) - .withProperty("quarkus.datasource.password", database.getPassword()) - .withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl); + protected abstract RestService getApp(); @Test public void whenGetAllBooks_thenOK() { @@ -141,9 +126,4 @@ private String createBookAsUri(Book book) { return API_ROOT + "/" + response.jsonPath() .get("id"); } - - @Override - public RestService getApp() { - return app; - } } diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftHomePageIT.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftSpringWebQuteIT.java similarity index 67% rename from spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftHomePageIT.java rename to spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftSpringWebQuteIT.java index 50e30a930..7c8c2c44b 100644 --- a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftHomePageIT.java +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftSpringWebQuteIT.java @@ -1,18 +1,19 @@ package io.quarkus.ts.spring.web.reactive.boostrap; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.IMAGE_105; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.PORT; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.START_LOG_105; + import io.quarkus.test.bootstrap.MariaDbService; import io.quarkus.test.bootstrap.RestService; import io.quarkus.test.scenarios.OpenShiftScenario; import io.quarkus.test.services.Container; import io.quarkus.test.services.QuarkusApplication; -import io.quarkus.ts.spring.web.reactive.AbstractDbIT; @OpenShiftScenario -public class OpenShiftHomePageIT extends AbstractDbIT { - - static final int MARIADB_PORT = 3306; +public class OpenShiftSpringWebQuteIT extends AbstractSpringWebQuteIT { - @Container(image = "${mariadb.105.image}", port = MARIADB_PORT, expectedLog = "Only MySQL server logs after this point") + @Container(image = IMAGE_105, port = PORT, expectedLog = START_LOG_105) static final MariaDbService database = new MariaDbService(); @QuarkusApplication diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftBookResourceIT.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftSpringWebRestIT.java similarity index 71% rename from spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftBookResourceIT.java rename to spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftSpringWebRestIT.java index edb8d4c39..a7d76d9c5 100644 --- a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftBookResourceIT.java +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/OpenShiftSpringWebRestIT.java @@ -1,5 +1,9 @@ package io.quarkus.ts.spring.web.reactive.boostrap; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.IMAGE_105; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.PORT; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.START_LOG_105; + import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import io.quarkus.test.bootstrap.MariaDbService; @@ -7,15 +11,12 @@ import io.quarkus.test.scenarios.OpenShiftScenario; import io.quarkus.test.services.Container; import io.quarkus.test.services.QuarkusApplication; -import io.quarkus.ts.spring.web.reactive.AbstractDbIT; @OpenShiftScenario @EnabledIfSystemProperty(named = "ts.redhat.registry.enabled", matches = "true") -public class OpenShiftBookResourceIT extends AbstractDbIT { - - static final int MARIADB_PORT = 3306; +public class OpenShiftSpringWebRestIT extends AbstractSpringWebRestIT { - @Container(image = "${mariadb.105.image}", port = MARIADB_PORT, expectedLog = "Only MySQL server logs after this point") + @Container(image = IMAGE_105, port = PORT, expectedLog = START_LOG_105) static final MariaDbService database = new MariaDbService(); @QuarkusApplication diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/HomePageIT.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/SpringWebQuteIT.java similarity index 68% rename from spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/HomePageIT.java rename to spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/SpringWebQuteIT.java index 8afe45016..f607f886f 100644 --- a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/HomePageIT.java +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/SpringWebQuteIT.java @@ -1,17 +1,19 @@ package io.quarkus.ts.spring.web.reactive.boostrap; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.IMAGE_10; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.PORT; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.START_LOG_10; + import io.quarkus.test.bootstrap.MariaDbService; import io.quarkus.test.bootstrap.RestService; import io.quarkus.test.scenarios.QuarkusScenario; import io.quarkus.test.services.Container; import io.quarkus.test.services.QuarkusApplication; -import io.quarkus.ts.spring.web.reactive.AbstractDbIT; -import io.quarkus.ts.spring.web.reactive.MariaDBUtils; @QuarkusScenario -public class HomePageIT extends AbstractDbIT { +public class SpringWebQuteIT extends AbstractSpringWebQuteIT { - @Container(image = "${mariadb.10.image}", port = MariaDBUtils.PORT, expectedLog = MariaDBUtils.START_LOG) + @Container(image = IMAGE_10, port = PORT, expectedLog = START_LOG_10) static final MariaDbService database = new MariaDbService(); @QuarkusApplication diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/SpringWebRestIT.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/SpringWebRestIT.java new file mode 100644 index 000000000..ab89e54a3 --- /dev/null +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/boostrap/SpringWebRestIT.java @@ -0,0 +1,29 @@ +package io.quarkus.ts.spring.web.reactive.boostrap; + +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.IMAGE_10; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.PORT; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.START_LOG_10; + +import io.quarkus.test.bootstrap.MariaDbService; +import io.quarkus.test.bootstrap.RestService; +import io.quarkus.test.scenarios.QuarkusScenario; +import io.quarkus.test.services.Container; +import io.quarkus.test.services.QuarkusApplication; + +@QuarkusScenario +public class SpringWebRestIT extends AbstractSpringWebRestIT { + + @Container(image = IMAGE_10, port = PORT, expectedLog = START_LOG_10) + static final MariaDbService database = new MariaDbService(); + + @QuarkusApplication + private static final RestService app = new RestService() + .withProperty("quarkus.datasource.username", database.getUser()) + .withProperty("quarkus.datasource.password", database.getPassword()) + .withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl); + + @Override + protected RestService getApp() { + return app; + } +} diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/OpenApiIT.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/AbstractSpringWebOpenApiIT.java similarity index 60% rename from spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/OpenApiIT.java rename to spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/AbstractSpringWebOpenApiIT.java index c4981afbc..d42b18254 100644 --- a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/OpenApiIT.java +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/AbstractSpringWebOpenApiIT.java @@ -6,43 +6,21 @@ import org.apache.http.HttpStatus; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvFileSource; -import io.quarkus.test.bootstrap.MariaDbService; import io.quarkus.test.bootstrap.RestService; -import io.quarkus.test.scenarios.QuarkusScenario; -import io.quarkus.test.services.Container; -import io.quarkus.test.services.QuarkusApplication; -import io.quarkus.ts.spring.web.reactive.AbstractDbIT; -import io.quarkus.ts.spring.web.reactive.MariaDBUtils; import io.restassured.response.Response; -@QuarkusScenario -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class OpenApiIT extends AbstractDbIT { +public abstract class AbstractSpringWebOpenApiIT { private static Response response; - @Container(image = "${mariadb.10.image}", port = MariaDBUtils.PORT, expectedLog = MariaDBUtils.START_LOG) - static final MariaDbService database = new MariaDbService(); - - @QuarkusApplication - private static final RestService app = new RestService() - .withProperty("quarkus.datasource.username", database.getUser()) - .withProperty("quarkus.datasource.password", database.getPassword()) - .withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl); - - @Override - public RestService getApp() { - return app; - } + protected abstract RestService getApp(); private void callOpenApiEndpoint() { - response = app.given().get("/q/openapi?format=JSON"); + response = getApp().given().get("/q/openapi?format=JSON"); } @Order(1) @@ -75,4 +53,5 @@ private void checkType(Stream jsonPathStream, String type) { Assertions.assertEquals(1, objectMap.keySet().size()); Assertions.assertEquals(type, objectMap.keySet().iterator().next()); } + } diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/OpenShiftOpenApiIT.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/OpenShiftSpringWebOpenApiIT.java similarity index 63% rename from spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/OpenShiftOpenApiIT.java rename to spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/OpenShiftSpringWebOpenApiIT.java index c2c6e6e76..b53f50506 100644 --- a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/OpenShiftOpenApiIT.java +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/OpenShiftSpringWebOpenApiIT.java @@ -1,5 +1,11 @@ package io.quarkus.ts.spring.web.reactive.openapi; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.IMAGE_105; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.PORT; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.START_LOG_105; + +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import io.quarkus.test.bootstrap.MariaDbService; @@ -7,15 +13,13 @@ import io.quarkus.test.scenarios.OpenShiftScenario; import io.quarkus.test.services.Container; import io.quarkus.test.services.QuarkusApplication; -import io.quarkus.ts.spring.web.reactive.AbstractDbIT; @OpenShiftScenario +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) @EnabledIfSystemProperty(named = "ts.redhat.registry.enabled", matches = "true") -public class OpenShiftOpenApiIT extends AbstractDbIT { - - static final int MARIADB_PORT = 3306; +public class OpenShiftSpringWebOpenApiIT extends AbstractSpringWebOpenApiIT { - @Container(image = "${mariadb.105.image}", port = MARIADB_PORT, expectedLog = "Only MySQL server logs after this point") + @Container(image = IMAGE_105, port = PORT, expectedLog = START_LOG_105) static final MariaDbService database = new MariaDbService(); @QuarkusApplication diff --git a/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/SpringWebOpenApiIT.java b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/SpringWebOpenApiIT.java new file mode 100644 index 000000000..455f06861 --- /dev/null +++ b/spring/spring-web/src/test/java/io/quarkus/ts/spring/web/reactive/openapi/SpringWebOpenApiIT.java @@ -0,0 +1,35 @@ +package io.quarkus.ts.spring.web.reactive.openapi; + +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.IMAGE_10; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.PORT; +import static io.quarkus.ts.spring.web.reactive.MariaDBConstants.START_LOG_10; + +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.TestMethodOrder; + +import io.quarkus.test.bootstrap.MariaDbService; +import io.quarkus.test.bootstrap.RestService; +import io.quarkus.test.scenarios.QuarkusScenario; +import io.quarkus.test.services.Container; +import io.quarkus.test.services.QuarkusApplication; +import io.restassured.response.Response; + +@QuarkusScenario +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +public class SpringWebOpenApiIT extends AbstractSpringWebOpenApiIT { + private static Response response; + + @Container(image = IMAGE_10, port = PORT, expectedLog = START_LOG_10) + static final MariaDbService database = new MariaDbService(); + + @QuarkusApplication + private static final RestService app = new RestService() + .withProperty("quarkus.datasource.username", database.getUser()) + .withProperty("quarkus.datasource.password", database.getPassword()) + .withProperty("quarkus.datasource.jdbc.url", database::getJdbcUrl); + + @Override + public RestService getApp() { + return app; + } +} From 8332e8cc881fad8cba28643191f9ee990ba99aea Mon Sep 17 00:00:00 2001 From: Josef Smrcka Date: Thu, 9 Jun 2022 17:22:05 +0200 Subject: [PATCH 11/11] Rename test classes in spring-data module (cherry picked from commit 1f12f30909ea10ff82b47ce25d53fc927ff65603) --- ...esourceIT.java => OpenShiftSpringDataCompositeEntityIT.java} | 2 +- ...okResourceIT.java => OpenShiftSpringDataSimpleEntityIT.java} | 2 +- ...DataBookResourceIT.java => SpringDataCompositeEntityIT.java} | 2 +- ...ringDataCatResourceIT.java => SpringDataSimpleEntityIT.java} | 2 +- ...braryRepositoryIT.java => CrudRepositoryRestResourceIT.java} | 2 +- ...sitoryIT.java => OpenShiftCrudRepositoryRestResourceIT.java} | 2 +- ...a => OpenShiftPagingAndSortingRepositoryRestResourceIT.java} | 2 +- ...oryIT.java => PagingAndSortingRepositoryRestResourceIT.java} | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/{OpenShiftCatResourceIT.java => OpenShiftSpringDataCompositeEntityIT.java} (58%) rename spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/{OpenShiftBookResourceIT.java => OpenShiftSpringDataSimpleEntityIT.java} (60%) rename spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/{SpringDataBookResourceIT.java => SpringDataCompositeEntityIT.java} (98%) rename spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/{SpringDataCatResourceIT.java => SpringDataSimpleEntityIT.java} (95%) rename spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/{LibraryRepositoryIT.java => CrudRepositoryRestResourceIT.java} (97%) rename spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/{OpenShiftArticleRepositoryIT.java => OpenShiftCrudRepositoryRestResourceIT.java} (56%) rename spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/{OpenShiftLibraryRepositoryIT.java => OpenShiftPagingAndSortingRepositoryRestResourceIT.java} (50%) rename spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/{ArticleRepositoryIT.java => PagingAndSortingRepositoryRestResourceIT.java} (98%) diff --git a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftCatResourceIT.java b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftSpringDataCompositeEntityIT.java similarity index 58% rename from spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftCatResourceIT.java rename to spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftSpringDataCompositeEntityIT.java index c541c2c6f..705719fd1 100644 --- a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftCatResourceIT.java +++ b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftSpringDataCompositeEntityIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftCatResourceIT extends SpringDataCatResourceIT { +public class OpenShiftSpringDataCompositeEntityIT extends SpringDataCompositeEntityIT { } diff --git a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftBookResourceIT.java b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftSpringDataSimpleEntityIT.java similarity index 60% rename from spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftBookResourceIT.java rename to spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftSpringDataSimpleEntityIT.java index 99b52e56d..a03d059dc 100644 --- a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftBookResourceIT.java +++ b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/OpenShiftSpringDataSimpleEntityIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftBookResourceIT extends SpringDataBookResourceIT { +public class OpenShiftSpringDataSimpleEntityIT extends SpringDataSimpleEntityIT { } diff --git a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataBookResourceIT.java b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataCompositeEntityIT.java similarity index 98% rename from spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataBookResourceIT.java rename to spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataCompositeEntityIT.java index 4d960b998..e3aecbbd5 100644 --- a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataBookResourceIT.java +++ b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataCompositeEntityIT.java @@ -24,7 +24,7 @@ import io.restassured.response.Response; @QuarkusScenario -public class SpringDataBookResourceIT extends AbstractDbIT { +public class SpringDataCompositeEntityIT extends AbstractDbIT { @DisabledOnQuarkusVersion(version = "(2\\.[0-6]\\..*)|(2\\.7\\.[0-5]\\..*)|(2\\.8\\.0\\..*)", reason = "Fixed in Quarkus 2.8.1 and backported to 2.7.6.") @Test diff --git a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataCatResourceIT.java b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataSimpleEntityIT.java similarity index 95% rename from spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataCatResourceIT.java rename to spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataSimpleEntityIT.java index 54091feb3..1562d7d3d 100644 --- a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataCatResourceIT.java +++ b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/primitivetypes/SpringDataSimpleEntityIT.java @@ -15,7 +15,7 @@ import io.restassured.response.Response; @QuarkusScenario -public class SpringDataCatResourceIT extends AbstractDbIT { +public class SpringDataSimpleEntityIT extends AbstractDbIT { @Test void testCustomFindPublicationYearObjectBoolean() { app.given().get("/cat/customFindDistinctiveObject/2").then() diff --git a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/LibraryRepositoryIT.java b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/CrudRepositoryRestResourceIT.java similarity index 97% rename from spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/LibraryRepositoryIT.java rename to spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/CrudRepositoryRestResourceIT.java index 96ee7e4ce..1eb3ff146 100644 --- a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/LibraryRepositoryIT.java +++ b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/CrudRepositoryRestResourceIT.java @@ -10,7 +10,7 @@ import io.quarkus.ts.spring.data.AbstractDbIT; @QuarkusScenario -public class LibraryRepositoryIT extends AbstractDbIT { +public class CrudRepositoryRestResourceIT extends AbstractDbIT { @Test void testAllRepositoryMethods() throws InterruptedException { diff --git a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftArticleRepositoryIT.java b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftCrudRepositoryRestResourceIT.java similarity index 56% rename from spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftArticleRepositoryIT.java rename to spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftCrudRepositoryRestResourceIT.java index 01a52142f..0a54d0c04 100644 --- a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftArticleRepositoryIT.java +++ b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftCrudRepositoryRestResourceIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftArticleRepositoryIT extends ArticleRepositoryIT { +public class OpenShiftCrudRepositoryRestResourceIT extends CrudRepositoryRestResourceIT { } diff --git a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftLibraryRepositoryIT.java b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftPagingAndSortingRepositoryRestResourceIT.java similarity index 50% rename from spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftLibraryRepositoryIT.java rename to spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftPagingAndSortingRepositoryRestResourceIT.java index 9807a6585..1e20e2c6a 100644 --- a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftLibraryRepositoryIT.java +++ b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/OpenShiftPagingAndSortingRepositoryRestResourceIT.java @@ -3,5 +3,5 @@ import io.quarkus.test.scenarios.OpenShiftScenario; @OpenShiftScenario -public class OpenShiftLibraryRepositoryIT extends LibraryRepositoryIT { +public class OpenShiftPagingAndSortingRepositoryRestResourceIT extends PagingAndSortingRepositoryRestResourceIT { } diff --git a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/ArticleRepositoryIT.java b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/PagingAndSortingRepositoryRestResourceIT.java similarity index 98% rename from spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/ArticleRepositoryIT.java rename to spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/PagingAndSortingRepositoryRestResourceIT.java index 48250c9df..3bc63cccf 100644 --- a/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/ArticleRepositoryIT.java +++ b/spring/spring-data/src/test/java/io/quarkus/ts/spring/data/rest/PagingAndSortingRepositoryRestResourceIT.java @@ -17,7 +17,7 @@ import io.restassured.response.Response; @QuarkusScenario -class ArticleRepositoryIT extends AbstractDbIT { +class PagingAndSortingRepositoryRestResourceIT extends AbstractDbIT { @Test void testAllRepositoryMethods() throws InterruptedException {