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; 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") 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 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); } 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); + } } 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 { } 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; 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"; 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()); + } +} 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 { 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; + } +}