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.
Intercepted subclasses generation - fix skipped methods evaluation
- do not skip methods with a private param - also do not evaluate methods that declare no interceptor bindings; these methods are skipped automatically - related to quarkusio#19177
- Loading branch information
Showing
3 changed files
with
148 additions
and
53 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
66 changes: 66 additions & 0 deletions
66
...src/test/java/io/quarkus/arc/test/interceptors/invalidparams/NonPublicParametersTest.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,66 @@ | ||
package io.quarkus.arc.test.interceptors.invalidparams; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import javax.annotation.Priority; | ||
import javax.inject.Singleton; | ||
import javax.interceptor.AroundInvoke; | ||
import javax.interceptor.Interceptor; | ||
import javax.interceptor.InvocationContext; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.arc.Arc; | ||
import io.quarkus.arc.ArcContainer; | ||
import io.quarkus.arc.test.ArcTestContainer; | ||
import io.quarkus.arc.test.interceptors.Simple; | ||
import io.quarkus.arc.test.interceptors.invalidparams.charlie.Charlie; | ||
|
||
public class NonPublicParametersTest { | ||
|
||
@RegisterExtension | ||
public ArcTestContainer container = new ArcTestContainer(Simple.class, SimpleBean.class, | ||
SimpleInterceptor.class); | ||
|
||
@Test | ||
public void testInterception() { | ||
ArcContainer arc = Arc.container(); | ||
SimpleBean simpleBean = arc.instance(SimpleBean.class).get(); | ||
assertEquals("FOO", | ||
simpleBean.foo(null, new Bar(), new Baz(), null)); | ||
} | ||
|
||
@Singleton | ||
static class SimpleBean extends Charlie { | ||
|
||
@Simple | ||
String foo(Foo foo, Bar bar, Baz baz, CharlieParam charlie) { | ||
return "foo"; | ||
} | ||
|
||
private static class Foo { | ||
} | ||
|
||
} | ||
|
||
static class Bar { | ||
|
||
} | ||
|
||
protected static class Baz { | ||
|
||
} | ||
|
||
@Simple | ||
@Priority(1) | ||
@Interceptor | ||
public static class SimpleInterceptor { | ||
|
||
@AroundInvoke | ||
Object mySuperCoolAroundInvoke(InvocationContext ctx) throws Exception { | ||
return ctx.proceed().toString().toUpperCase(); | ||
} | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
...c/tests/src/test/java/io/quarkus/arc/test/interceptors/invalidparams/charlie/Charlie.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,9 @@ | ||
package io.quarkus.arc.test.interceptors.invalidparams.charlie; | ||
|
||
public class Charlie { | ||
|
||
protected class CharlieParam { | ||
|
||
} | ||
|
||
} |