-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 #21781 from mkouba/issue-19177
Intercepted subclasses generation - fix evaluation of skipped methods
- Loading branch information
Showing
3 changed files
with
157 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
69 changes: 69 additions & 0 deletions
69
...c/test/java/io/quarkus/arc/test/interceptors/nonpublicparams/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,69 @@ | ||
package io.quarkus.arc.test.interceptors.nonpublicparams; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
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.nonpublicparams.charlie.Charlie; | ||
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; | ||
|
||
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"; | ||
} | ||
|
||
@Simple | ||
String fooArray(Foo[] foo, boolean isOk) { | ||
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
...tests/src/test/java/io/quarkus/arc/test/interceptors/nonpublicparams/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.nonpublicparams.charlie; | ||
|
||
public class Charlie { | ||
|
||
protected class CharlieParam { | ||
|
||
} | ||
|
||
} |