forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#19762 from geoand/quarkusio#19757
Provide actionable error message when non-static inner class used as JAX-RS resource
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...ive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/InnerClassTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.quarkus.resteasy.reactive.server.test; | ||
|
||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import javax.enterprise.inject.spi.DeploymentException; | ||
import javax.ws.rs.Path; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.smallrye.common.annotation.Blocking; | ||
|
||
public class InnerClassTest { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.setArchiveProducer(new Supplier<>() { | ||
@Override | ||
public JavaArchive get() { | ||
return ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(Resource.class); | ||
} | ||
}).setExpectedException(DeploymentException.class); | ||
|
||
@Test | ||
public void test() { | ||
fail("Should never have been called"); | ||
} | ||
|
||
@Path("test") | ||
public class Resource { | ||
|
||
@Path("hello") | ||
@Blocking | ||
public String hello() { | ||
return "hello"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters