Closed Article23399 closed 3 years ago
同样的问题
问题收到,今晚会做个复现然后看下为什么在发版前的回归测试没有发现出来
使用以上代码未复现问题。这里System.loadLibrary()
的调用在JNIClass
类型中,在TestServiceTest.Mock
类里声明的loadLibrary()
方法应该不会引发任何置换动作,试了将JNIClass
中的方法移到TestService
类中,此时Mock正常生效,没有遇到StringIndexOutOfBoundsException
异常。
我们会排查一下可能导致下标溢出的逻辑,尝试下个版本里做个修复。如果有其他能复现此问题的代码,也欢迎提供。
使用以上代码未复现问题。
这是三个文件,我又新建了一个spirng boot项目试了下稳定复现
已定位,和@MockDiagnose(LogLevel.VERBOSE)
功能有关,当Mock了返回值为void
的方法,且开启VERBOSE
级别调试日志的时候会复现。
已提交修复到主干,会包含在下个版本里。
0.5.2
版本已发布,包含此问题的修复
会报