Skip to content

Commit

Permalink
do not invoke test method(apache#13589)
Browse files Browse the repository at this point in the history
  • Loading branch information
vio-lin committed Dec 29, 2023
1 parent 1f84cdc commit 2f14353
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.common.extension.DisableInject;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.ReflectUtils;
Expand Down Expand Up @@ -108,7 +109,8 @@ public void onError(Throwable e, Invoker<?> invoker, Invocation invocation) {
}

// For test purpose
public void setLogger(Logger logger) {
@DisableInject
public void mockLogger(Logger logger) {
this.logger = logger;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testRpcException() {
exceptionFilter.invoke(invoker, invocation);
} catch (RpcException e) {
assertEquals("TestRpcException", e.getMessage());
exceptionFilter.setLogger(logger);
exceptionFilter.mockLogger(logger);
exceptionFilter.onError(e, invoker, invocation);
}

Expand Down

0 comments on commit 2f14353

Please sign in to comment.