From c567f10e8bc48aa214751627ffc77b6dae9bcd6c Mon Sep 17 00:00:00 2001 From: Tomas Hofman Date: Tue, 21 Sep 2021 16:08:52 +0200 Subject: [PATCH] Rest client configuration: fix tests --- .../reactive/ClassNameScopeOverrideTest.java | 3 ++- .../client/reactive/ConfigurationTest.java | 3 ++- .../reactive/LegacyConfigurationTest.java | 3 ++- .../MpClassNameScopeOverrideTest.java | 3 ++- .../reactive/ShortNameScopeOverrideTest.java | 3 ++- .../reactive/configuration/EchoResource.java | 19 +++++++++++++++++++ 6 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/configuration/EchoResource.java diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ClassNameScopeOverrideTest.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ClassNameScopeOverrideTest.java index b39d8068efc7e9..cf5d1ec7a6bfcb 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ClassNameScopeOverrideTest.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ClassNameScopeOverrideTest.java @@ -15,13 +15,14 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.arc.Arc; +import io.quarkus.rest.client.reactive.configuration.EchoResource; import io.quarkus.test.QuarkusUnitTest; public class ClassNameScopeOverrideTest { @RegisterExtension static final QuarkusUnitTest TEST = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) - .addClasses(HelloResource.class, HelloClientWithBaseUri.class)) + .addClasses(EchoResource.class, HelloClientWithBaseUri.class)) .withConfigurationResource("classname-scope-test-application.properties"); @RestClient diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ConfigurationTest.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ConfigurationTest.java index 87c5bfd3dec984..aaab518a3ffc4e 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ConfigurationTest.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ConfigurationTest.java @@ -17,6 +17,7 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.arc.Arc; +import io.quarkus.rest.client.reactive.configuration.EchoResource; import io.quarkus.restclient.config.RestClientConfig; import io.quarkus.restclient.config.RestClientsConfig; import io.quarkus.test.QuarkusUnitTest; @@ -26,7 +27,7 @@ public class ConfigurationTest { @RegisterExtension static final QuarkusUnitTest TEST = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) - .addClasses(HelloClientWithBaseUri.class, HelloResource.class)) + .addClasses(HelloClientWithBaseUri.class, EchoResource.class)) .withConfigurationResource("configuration-test-application.properties"); @RestClient diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/LegacyConfigurationTest.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/LegacyConfigurationTest.java index d184ce3a9f2620..16a635c27ecca5 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/LegacyConfigurationTest.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/LegacyConfigurationTest.java @@ -9,6 +9,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import io.quarkus.rest.client.reactive.configuration.EchoResource; import io.quarkus.restclient.config.RestClientConfig; import io.quarkus.restclient.config.RestClientsConfig; import io.quarkus.test.QuarkusUnitTest; @@ -18,7 +19,7 @@ public class LegacyConfigurationTest { @RegisterExtension static final QuarkusUnitTest TEST = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) - .addClasses(HelloClientWithBaseUri.class, HelloResource.class)) + .addClasses(HelloClientWithBaseUri.class, EchoResource.class)) .withConfigurationResource("legacy-configuration-test-application.properties"); @Inject diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/MpClassNameScopeOverrideTest.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/MpClassNameScopeOverrideTest.java index e84642a2e4f515..e8af8cb57643d6 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/MpClassNameScopeOverrideTest.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/MpClassNameScopeOverrideTest.java @@ -15,13 +15,14 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.arc.Arc; +import io.quarkus.rest.client.reactive.configuration.EchoResource; import io.quarkus.test.QuarkusUnitTest; public class MpClassNameScopeOverrideTest { @RegisterExtension static final QuarkusUnitTest TEST = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) - .addClasses(HelloResource.class, HelloClientWithBaseUri.class)) + .addClasses(EchoResource.class, HelloClientWithBaseUri.class)) .withConfigurationResource("mp-classname-scope-test-application.properties"); @RestClient diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ShortNameScopeOverrideTest.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ShortNameScopeOverrideTest.java index a3a36da2a3f3da..ae7162c5eda3c1 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ShortNameScopeOverrideTest.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/ShortNameScopeOverrideTest.java @@ -15,13 +15,14 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.arc.Arc; +import io.quarkus.rest.client.reactive.configuration.EchoResource; import io.quarkus.test.QuarkusUnitTest; public class ShortNameScopeOverrideTest { @RegisterExtension static final QuarkusUnitTest TEST = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) - .addClasses(HelloResource.class, HelloClientWithBaseUri.class)) + .addClasses(EchoResource.class, HelloClientWithBaseUri.class)) .withConfigurationResource("shortname-scope-test-application.properties"); @RestClient diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/configuration/EchoResource.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/configuration/EchoResource.java new file mode 100644 index 00000000000000..2fe910d4973b8e --- /dev/null +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/test/java/io/quarkus/rest/client/reactive/configuration/EchoResource.java @@ -0,0 +1,19 @@ +package io.quarkus.rest.client.reactive.configuration; + +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Request; + +@Path("/hello") +@Produces(MediaType.TEXT_PLAIN) +@Consumes(MediaType.TEXT_PLAIN) +public class EchoResource { + @POST + public String echo(String name, @Context Request request) { + return "hello, " + name; + } +}