diff --git a/docs/en-us/doc/troubleshooting.md b/docs/en-us/doc/troubleshooting.md index f0e1473..1022934 100644 --- a/docs/en-us/doc/troubleshooting.md +++ b/docs/en-us/doc/troubleshooting.md @@ -38,3 +38,9 @@ The output log example is as follows: ``` The log shows all the mocked invocation and corresponding code line numbers in the class under test. + +- Self troubleshooting: + +- If there is no output, please check whether the `pom.xml` or `build.gradle` configuration correctly introduces `TestableMock` dependencies +- If only the first line of `Handling test class` is output, please check whether the test class is in the same package of the class under test, and the name is "+Test" (required for `0.4.x` version) +- If `Handling source class` and `Handling method xxx` are output, but there is no mock replacement happen at the expected code line, please check whether the mock method definition matches the target method diff --git a/docs/zh-cn/doc/troubleshooting.md b/docs/zh-cn/doc/troubleshooting.md index d5905c1..721f2f7 100644 --- a/docs/zh-cn/doc/troubleshooting.md +++ b/docs/zh-cn/doc/troubleshooting.md @@ -38,3 +38,9 @@ class DemoTest { ``` 该日志展示了被测类中所有发生了Mock替换的调用和相应代码行号。 + +简单排查方法: + +- 若没有任何输出,请检查`pom.xml`或`build.gradle`配置是否正确引入了TestableMock依赖 +- 若只输出了第一行`Handling test class`,请检查被测类与测试类是否包路径相同,且名称为"被测类+Test"(`0.4.x`版本要求) +- 若输出了`Handling source class`以及`Handling method xxx`,但预期的代码行位置没有发生Mock替换,请检查Mock方法定义是否未与目标方法匹配