-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Improve support for conditional bean and declarative filter annotations combination
- Loading branch information
Showing
4 changed files
with
116 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
62 changes: 62 additions & 0 deletions
62
...rkus/resteasy/reactive/server/test/customproviders/InvalidConditionalBeanFiltersTest.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,62 @@ | ||
package io.quarkus.resteasy.reactive.server.test.customproviders; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.core.UriInfo; | ||
|
||
import org.jboss.resteasy.reactive.server.ServerRequestFilter; | ||
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.arc.profile.IfBuildProfile; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class InvalidConditionalBeanFiltersTest { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.setArchiveProducer(new Supplier<>() { | ||
@Override | ||
public JavaArchive get() { | ||
return ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(TestResource.class, Filters.class); | ||
} | ||
}).assertException(t -> { | ||
String message = t.getMessage(); | ||
assertTrue(message.contains("@IfBuildProfile")); | ||
assertTrue(message.contains("request")); | ||
assertTrue(message.contains(InvalidConditionalBeanFiltersTest.Filters.class.getName())); | ||
}); | ||
|
||
@Test | ||
public void test() { | ||
fail("Should never have been called"); | ||
} | ||
|
||
@Path("test") | ||
public static class TestResource { | ||
|
||
@GET | ||
public String hello() { | ||
return "hello"; | ||
} | ||
|
||
} | ||
|
||
public static class Filters { | ||
|
||
@IfBuildProfile("test") | ||
@ServerRequestFilter | ||
public void request(UriInfo info) { | ||
|
||
} | ||
|
||
} | ||
} |