diff --git a/extensions/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java b/extensions/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java index c8a4aae8b8132c..1e67bf64acf958 100755 --- a/extensions/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java +++ b/extensions/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java @@ -259,6 +259,10 @@ public void build( String className = implementor.name().toString(); reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, className)); scannedResources.putIfAbsent(implementor.name(), implementor); + + if (!implementor.hasNoArgsConstructor()) { + withoutDefaultCtor.put(implementor.name(), implementor); + } } } diff --git a/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/InterfaceResource.java b/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/InterfaceResource.java new file mode 100644 index 00000000000000..09325e0a18e037 --- /dev/null +++ b/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/InterfaceResource.java @@ -0,0 +1,15 @@ +package io.quarkus.resteasy.test; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +@Path("/inter") +public interface InterfaceResource { + + @Path("/hello") + @GET + @Produces(MediaType.TEXT_PLAIN) + String hello(); +} diff --git a/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/InterfaceResourceImpl.java b/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/InterfaceResourceImpl.java new file mode 100644 index 00000000000000..f52daaaeaf7465 --- /dev/null +++ b/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/InterfaceResourceImpl.java @@ -0,0 +1,15 @@ +package io.quarkus.resteasy.test; + +public class InterfaceResourceImpl implements InterfaceResource { + + private Service service; + + public InterfaceResourceImpl(Service service) { + this.service = service; + } + + @Override + public String hello() { + return "hello from impl"; + } +} diff --git a/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/RestEasyDevModeTestCase.java b/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/RestEasyDevModeTestCase.java index 61192b4583dd08..5ad185a6670192 100644 --- a/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/RestEasyDevModeTestCase.java +++ b/extensions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/RestEasyDevModeTestCase.java @@ -20,6 +20,9 @@ public class RestEasyDevModeTestCase { .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) .addClass(PostResource.class) .addClass(GreetingResource.class) + .addClass(InterfaceResource.class) + .addClass(InterfaceResourceImpl.class) + .addClass(Service.class) .addAsResource("config-test.properties", "application.properties")); @Test @@ -54,4 +57,11 @@ public void testConfigHotReplacement() { .statusCode(200) .body(is("hi from dev mode")); } + + @Test + public void testInterfaceImplementation() { + RestAssured.when().get("/inter/hello").then() + .statusCode(200) + .body(is("hello from impl")); + } }