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.
- make sure that an interface method of an interface-based client proxy is invoked upon the provider type and not the type that declares the method - fixes quarkusio#29593
- Loading branch information
Showing
6 changed files
with
69 additions
and
1 deletion.
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
7 changes: 7 additions & 0 deletions
7
...arc/tests/src/test/java/io/quarkus/arc/test/clientproxy/packageprivate/BaseInterface.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,7 @@ | ||
package io.quarkus.arc.test.clientproxy.packageprivate; | ||
|
||
// this interface is intentionally package-private | ||
interface BaseInterface { | ||
|
||
String ping(); | ||
} |
5 changes: 5 additions & 0 deletions
5
...s/arc/tests/src/test/java/io/quarkus/arc/test/clientproxy/packageprivate/MyInterface.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,5 @@ | ||
package io.quarkus.arc.test.clientproxy.packageprivate; | ||
|
||
public interface MyInterface extends BaseInterface { | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...o/quarkus/arc/test/clientproxy/packageprivate/PackagePrivateInterfaceInHierarchyTest.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,24 @@ | ||
package io.quarkus.arc.test.clientproxy.packageprivate; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.arc.Arc; | ||
import io.quarkus.arc.test.ArcTestContainer; | ||
import io.quarkus.arc.test.clientproxy.packageprivate.foo.MyInterface2; | ||
import io.quarkus.arc.test.clientproxy.packageprivate.foo.Producer; | ||
|
||
public class PackagePrivateInterfaceInHierarchyTest { | ||
|
||
@RegisterExtension | ||
public ArcTestContainer container = new ArcTestContainer(BaseInterface.class, MyInterface.class, MyInterface2.class, | ||
Producer.class); | ||
|
||
@Test | ||
public void testProducer() { | ||
assertEquals("quarkus", Arc.container().instance(MyInterface2.class).get().ping()); | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
.../tests/src/test/java/io/quarkus/arc/test/clientproxy/packageprivate/foo/MyInterface2.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,7 @@ | ||
package io.quarkus.arc.test.clientproxy.packageprivate.foo; | ||
|
||
import io.quarkus.arc.test.clientproxy.packageprivate.MyInterface; | ||
|
||
public interface MyInterface2 extends MyInterface { | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
.../arc/tests/src/test/java/io/quarkus/arc/test/clientproxy/packageprivate/foo/Producer.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,20 @@ | ||
package io.quarkus.arc.test.clientproxy.packageprivate.foo; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.enterprise.inject.Produces; | ||
|
||
@ApplicationScoped | ||
public class Producer { | ||
|
||
@Produces | ||
@ApplicationScoped | ||
public MyInterface2 myInterface2() { | ||
return new MyInterface2() { | ||
@Override | ||
public String ping() { | ||
return "quarkus"; | ||
} | ||
}; | ||
} | ||
|
||
} |