Skip to content

Commit a72deaa

Browse files
committed
Polish Javadoc of MockedThroughWrapper
1 parent 45153c0 commit a72deaa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

core/runtime/src/main/java/io/quarkus/runtime/MockedThroughWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
/**
44
* Usually, QuarkusMock mocking replaces a "delegating instance" of a client proxy.
5-
*
6-
* In some cases, e.g. for REST Client Reactive, a CDI bean is a wrapper over a delegate.
5+
* <p>
6+
* In some cases, e.g. for REST Client, a CDI bean is a wrapper over a delegate.
77
* This interface allows to replace the delegate instead of the delegating instance of the proxy.
88
*/
99
public interface MockedThroughWrapper {

test-framework/junit5/src/main/java/io/quarkus/test/junit/MockSupport.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ static void popContext() {
2424
List<Object> val = contexts.pop();
2525
for (Object i : val) {
2626
try {
27-
if (i instanceof MockedThroughWrapper) {
28-
((MockedThroughWrapper) i).clearMock();
27+
if (i instanceof MockedThroughWrapper m) {
28+
m.clearMock();
2929
} else {
3030
i.getClass().getDeclaredMethod("arc$clearMock").invoke(i);
3131

@@ -45,8 +45,8 @@ static <T> void installMock(T instance, T mock) {
4545
throw new IllegalStateException("No test in progress");
4646
}
4747
try {
48-
if (instance instanceof MockedThroughWrapper) {
49-
((MockedThroughWrapper) instance).setMock(mock);
48+
if (instance instanceof MockedThroughWrapper m) {
49+
m.setMock(mock);
5050
inst.add(instance);
5151
} else {
5252

0 commit comments

Comments
 (0)