Java单元测试实践-15.Stub、Replace、Suppress Spring的方法

本文详细介绍如何使用PowerMockito对Spring的@Component组件进行Stub、Replace、Suppress操作,包括方法的覆盖范围、@PrepareForTest注解的使用、不同操作的生效情况及对Mock/Spy对象的影响。

Java单元测试实践-00.目录(9万多字文档+700多测试示例)
https://blog.youkuaiyun.com/a82514921/article/details/107969340

1. Stub、Replace、Suppress Spring的方法

对Spring的@Component组件的方法进行Stub、Replace、Suppress时,与对Mock/Spy对象进行Stub相比,区别在于前者的作用范围是指定类的全部实例;后者的作用范围是指定的Mock/Spy对象。

1.1. 对Spring的@Component组件方法进行Stub

使用PowerMockito.stub()方法支持对Spring的@Component组件方法进行Stub。可参考前文对静态方法的处理。

使用PowerMockito.stub()对方法进行Stub时,作用范围是指定类的全部实例。

当间接调用被Stub方法时,Stub也生效。可参考示例TestSpStubPuNV3类test1方法。

  • 使用@PrepareForTest注解

使用PowerMockito.stub()方法对Spring的@Component组件方法进行Stub,需要使用@PrepareForTest注解指定Spring的@Component组件的实现类。

当不使用@PrepareForTest注解指定Spring的@Component组件实现类时,Stub不生效。可参考示例TestSpStubPuNV1类。

当使用@PrepareForTest注解指定Spring的@Component组件接口时,Stub不生效。可参考示例TestSpStubPuNV2类。

  • toReturn()与toThrow()方法

使用PowerMockito.stub()方法对Spring的@Component组件方法进行处理时,支持使用toReturn()与toThrow()方法。可参考示例TestSpStubPuNV3类test1、test2方法。

  • 使用Stubber.stubMethod()方法进行Stub

使用Stubber.stubMethod()方法支持对Spring的@Component组件方法进行Stub,使其返回指定值。支持传入Method对象,或Spring的@Component组件实现类Class对象与方法名。可参考示例TestSpStubPuNV3类test4、test5方法。

  • PowerMockito.stub()方法与Spring的@Component组件方法

PowerMockito.stub()方法支持对Spring的@Component组件的公有非void方法、公有void方法、私有非void方法、私有void方法进行Stub( void方法支持使用toThrow()处理 )。

公有非void方法的示例已在前文说明。公有void方法、私有非void方法、私有void方法可参考示例TestSpStubPuV1、TestSpStubPrNV1、TestSpStubPrV1。

1.2. 对Spring的@Component组件方法进行Replace

使用PowerMockito.replace()方法支持对Spring的@Component组件方法进行Replace。可参考前文对静态方法的处理。

使用PowerMockito.replace()对方法进行Replace时,作用范围是指定类的全部实例。

当间接调用被Replace方法时,Replace也生效。可参考示例TestSpReplacePuNV1类。

  • 使用@PrepareForTest注解

使用PowerMockito.stub()方法对Spring的@Component组件方法进行Replace,需要使用@PrepareForTest注解指定Spring的@Component组件的实现类。

  • 使用MethodProxy.proxy()方法进行Replace

使用MethodProxy.proxy()方法支持对Spring的@Component组件方法进行Replace。支持传入Method对象,或Spring的@Component组件实现类Class对象与方法名。可参考示例TestSpReplacePuNV2类。

  • PowerMockito.replace()方法与Spring的@Component组件方法

PowerMockito.replace().with()方法只支持静态方法,不支持Spring的@Component组件的非静态方法。 可参考示例TestSpReplacePuNV3类。

PowerMockito.replace()方法支持对Spring的@Component组件的公有非void方法、公有void方法、私有非void方法、私有void方法进行Replace。

公有非void方法的示例已在前文说明。公有void方法、私有非void方法、私有void方法可参考示例TestSpReplacePuV1、TestSpReplacePrNV1、TestSpReplacePrV1。

1.3. 对Spring的@Component组件进行Suppress

使用PowerMockito.suppress()方法支持对Spring的@Component组件的字段或方法进行Suppress。

1.3.1. 对字段进行Suppress

使用PowerMockito.suppress()对字段进行Suppress时,作用范围是指定类的全部实例。

当间接调用使用了被Suppress字段的方法时,Suppress也生效。可参考示例TestSpSuppressField1类test2方法。

  • 使用@PrepareForTest注解

使用PowerMockito.suppress()方法对字段进行Suppress,需要使用@PrepareForTest注解指定Spring的@Component组件的实现类。

  • 被Suppress字段的值

PowerMockito.suppress()方法支持对公有、受保护、私有的字段进行Suppress。

当字段被Suppress后,在对应的类的方法中获取字段值,为null、0、false等值。可参考示例TestSpSuppressField1类test1方法。

  • 获取字段实际值

通过反射获取被Suppress的字段,字段值仍为原始值,未被改变。可参考示例TestSpSuppressField1类test1方法。

  • 使用SuppressCode.suppressField()

使用SuppressCode.suppressField()可以对字段进行Suppress,可以传入Field对象。可参考示例TestSpSuppressField2类。

SuppressCode类的suppressField()方法除了支持传入Field类型的参数外,还支持传入“Class<?>[] classes”或“Class<?> clazz, String… fieldNames”参数,PowerMockito存在功能类似的方法,在此不进行说明。

1.3.2. 对方法进行Suppress

使用PowerMockito.suppress()对方法进行Suppress时,作用范围是指定类的全部实例。

当间接调用被Suppress方法时,Suppress也生效。可参考示例TestSpSuppressPuNVMethod2类。

  • 使用@PrepareForTest注解

使用PowerMockito.suppress()对方法进行Suppress,需要使用@PrepareForTest注解指定Spring的@Component组件的实现类。

  • 被Suppress方法的返回值

当方法被Suppress后,返回值为null、0、false等值,可参考前文对静态方法的处理。可参考示例TestSpSuppressPuNVMethod2类。

  • 使用SuppressCode.suppressMethod()

使用SuppressCode.suppressMethod()可以对方法进行Suppress,可以传入Method对象。可参考示例TestSpSuppressPuNVMethod3类。

SuppressCode类还提供了其他方法,支持对方法进行Suppress,如suppressConstructor()、suppressSpecificConstructor(),以及参数不同的suppressMethod()方法,PowerMockito存在功能类似的方法,在此不进行说明。

  • 对全部方法( 不含构造函数 )进行Suppress

使用PowerMockito.methodsDeclaredIn()方法可以获取指定类的全部方法( 不含构造函数 ),再使用PowerMockito类的suppress(Method[] methods)方法,可以对获取的全部方法进行Suppress。可参考示例TestSpSuppressMethods1类。

  • 对全部方法( 包含构造函数 )进行Suppress

使用PowerMockito.everythingDeclaredIn()方法可以获取指定类的全部方法( 包含构造函数 ),再使用PowerMockito类的suppress(Method[] methods)方法,可以对获取的全部方法进行Suppress。可参考示例TestSpSuppressEverything1类。

  • PowerMockito.suppress()方法与Spring的@Component组件方法

PowerMockito.suppress()方法支持对Spring的@Component组件的公有非void方法、公有void方法、私有非void方法、私有void方法进行Suppress。

公有非void方法的示例已在前文说明。公有void方法、私有非void方法、私有void方法可参考示例TestSpSuppressPuVMethod1、TestSpSuppressPrNVMethod1、TestSpSuppressPrVMethod1类。

1.4. 对同一个方法执行Mock/Spy后Stub、Stub、Replace、Suppress的生效情况

对同一个方法执行Mock/Spy后Stub、Stub、Replace、Suppress等操作时,生效的情况比较复杂,应避免对同一个方法执行不同的操作。

  • PowerMockito.stub().toReturn()执行多次的生效情况

当PowerMockito.stub().toReturn()对同一个方法执行多次时,最后一次执行的操作生效。可参考TestSpEffectiveStubToReturn1类。

  • PowerMockito.stub().toThrow()执行多次的生效情况

当PowerMockito.stub().toThrow()对同一个方法执行多次时,最后一次执行的操作生效。可参考TestSpEffectiveStubToThrow1类。

  • PowerMockito.stub()的toReturn()与toThrow()的生效情况

当PowerMockito.stub().toReturn()与PowerMockito.stub().toThrow()对同一个方法执行时,PowerMockito.stub().toReturn()的操作生效。可参考示例TestStEffectiveStubThrRe1类。

  • PowerMockito.replace().with()执行多次的生效情况

当PowerMockito.replace().with()对同一个方法执行多次时,最后一次执行的操作生效。可参考TestSpEffectiveReplace1类。

  • PowerMockito.stub()与PowerMockito.replace()的生效情况

当PowerMockito.stub().toReturn()、PowerMockito.stub().toThrow()与PowerMockito.replace().with()对同一个方法执行时,PowerMockito.stub().toReturn()的操作生效。可参考示例TestSpEffectiveStRe1类。

  • PowerMockito.stub().toThrow()与PowerMockito.replace()的生效情况

当PowerMockito.stub().toThrow()与PowerMockito.replace().with()对同一个方法执行时,后执行的操作生效。可参考示例TestSpEffectiveStThrRe1类。

  • PowerMockito类的stub()、replace()与suppress()的生效情况

当PowerMockito.stub().toReturn()、PowerMockito.stub().toThrow()、PowerMockito.replace().with()与PowerMockito.suppress()对同一个方法执行时,PowerMockito.suppress()的操作生效。可参考示例TestSpEffectiveStReSu1类。

  • PowerMockito类的stub()、replace()、suppress()对Mock/Spy对象的影响

PowerMockito类的stub()、replace()、suppress()方法,都无法对Spring的@Component组件实现类的Mock对象或Spy对象产生影响。只有Mockito.when()/Mockito.do…().when()方法对Spring的@Component组件实现类的Mock对象或Spy对象的Stub生效。

  • PowerMockito.stub().toReturn()对Mock/Spy对象的影响

可参考示例TestSpEffectiveMockStRet1、TestSpEffectiveMockStRet2Spy类。

  • PowerMockito.stub().toThrow()对Mock/Spy对象的影响

可参考示例TestSpEffectiveMockStThr1、TestSpEffectiveMockStThr2Spy类。

  • PowerMockito.replace()对Mock/Spy对象的影响

可参考示例TestSpEffectiveMockRe1、TestSpEffectiveMockRe2Spy类。

  • PowerMockito类的stub()、replace()对Mock/Spy对象的影响

可参考示例TestSpEffectiveMockStRe1、TestSpEffectiveMockStRe2Spy类。

  • PowerMockito.suppress()对Mock/Spy对象的影响

可参考示例TestSpEffectiveMockSu1、TestSpEffectiveMockSu2Spy类。

  • PowerMockito类的stub()、replace()与suppress()对Mock/Spy对象的影响

可参考示例TestSpEffectiveMockStReSu1、TestSpEffectiveMockStReSu2Spy类。

D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2024.3.6\lib\idea_rt.jar=65370" -javaagent:C:\Users\admin\AppData\Local\JetBrains\IntelliJIdea2024.3\captureAgent\debugger-agent.jar -Dkotlinx.coroutines.debug.enable.creation.stack.trace=false -Ddebugger.agent.enable.coroutines=true -Dkotlinx.coroutines.debug.enable.flows.stack.trace=true -Dkotlinx.coroutines.debug.enable.mutable.state.flows.stack.trace=true -Dfile.encoding=UTF-8 -classpath "D:\Program Files\JetBrains\IntelliJ IDEA 2024.3.6\lib\idea_rt.jar;D:\Program Files\JetBrains\IntelliJ IDEA 2024.3.6\plugins\junit\lib\junit5-rt.jar;D:\Program Files\JetBrains\IntelliJ IDEA 2024.3.6\plugins\junit\lib\junit-rt.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\charsets.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\access-bridge-64.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\cldrdata.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\dnsns.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\jaccess.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\jfxrt.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\localedata.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\nashorn.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\sunec.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\sunjce_provider.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\sunmscapi.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\sunpkcs11.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\ext\zipfs.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\jce.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\jfr.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\jfxswt.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\jsse.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\management-agent.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\resources.jar;D:\java\openlogic-openjdk-8u362-b09-windows-64\openlogic-openjdk-8u362-b09-windows-64\jre\lib\rt.jar;F:\lee\work\training-2025\litailong\basic-spring-boot\target\test-classes;F:\lee\work\training-2025\litailong\basic-spring-boot\target\classes;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-validation\2.7.18\spring-boot-starter-validation-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter\2.7.18\spring-boot-starter-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot\2.7.18\spring-boot-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-autoconfigure\2.7.18\spring-boot-autoconfigure-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-logging\2.7.18\spring-boot-starter-logging-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\ch\qos\logback\logback-classic\1.2.12\logback-classic-1.2.12.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\ch\qos\logback\logback-core\1.2.12\logback-core-1.2.12.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\apache\logging\log4j\log4j-to-slf4j\2.17.2\log4j-to-slf4j-2.17.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\apache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\slf4j\jul-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\yaml\snakeyaml\1.30\snakeyaml-1.30.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.83\tomcat-embed-el-9.0.83.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\hibernate\validator\hibernate-validator\6.2.5.Final\hibernate-validator-6.2.5.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\jakarta\validation\jakarta.validation-api\2.0.2\jakarta.validation-api-2.0.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\jboss\logging\jboss-logging\3.4.3.Final\jboss-logging-3.4.3.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-web\2.7.18\spring-boot-starter-web-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-json\2.7.18\spring-boot-starter-json-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.13.5\jackson-datatype-jdk8-2.13.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.13.5\jackson-datatype-jsr310-2.13.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.13.5\jackson-module-parameter-names-2.13.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-tomcat\2.7.18\spring-boot-starter-tomcat-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.83\tomcat-embed-core-9.0.83.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.83\tomcat-embed-websocket-9.0.83.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-web\5.3.31\spring-web-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-beans\5.3.31\spring-beans-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-webmvc\5.3.31\spring-webmvc-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-context\5.3.31\spring-context-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-expression\5.3.31\spring-expression-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-aop\2.7.18\spring-boot-starter-aop-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-aop\5.3.31\spring-aop-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\aspectj\aspectjweaver\1.9.7\aspectjweaver-1.9.7.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\projectlombok\lombok\1.18.30\lombok-1.18.30.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-test\2.7.18\spring-boot-starter-test-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-test\2.7.18\spring-boot-test-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-test-autoconfigure\2.7.18\spring-boot-test-autoconfigure-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\jayway\jsonpath\json-path\2.7.0\json-path-2.7.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\minidev\json-smart\2.4.11\json-smart-2.4.11.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\minidev\accessors-smart\2.4.11\accessors-smart-2.4.11.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\ow2\asm\asm\9.3\asm-9.3.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\assertj\assertj-core\3.22.0\assertj-core-3.22.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\hamcrest\hamcrest\2.2\hamcrest-2.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\junit\jupiter\junit-jupiter\5.8.2\junit-jupiter-5.8.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\junit\jupiter\junit-jupiter-api\5.8.2\junit-jupiter-api-5.8.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\opentest4j\opentest4j\1.2.0\opentest4j-1.2.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\junit\platform\junit-platform-commons\1.8.2\junit-platform-commons-1.8.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\apiguardian\apiguardian-api\1.1.2\apiguardian-api-1.1.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\junit\jupiter\junit-jupiter-params\5.8.2\junit-jupiter-params-5.8.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\junit\jupiter\junit-jupiter-engine\5.8.2\junit-jupiter-engine-5.8.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\junit\platform\junit-platform-engine\1.8.2\junit-platform-engine-1.8.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\mockito\mockito-core\4.5.1\mockito-core-4.5.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\bytebuddy\byte-buddy\1.12.23\byte-buddy-1.12.23.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\bytebuddy\byte-buddy-agent\1.12.23\byte-buddy-agent-1.12.23.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\objenesis\objenesis\3.2\objenesis-3.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\mockito\mockito-junit-jupiter\4.5.1\mockito-junit-jupiter-4.5.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\skyscreamer\jsonassert\1.5.1\jsonassert-1.5.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\vaadin\external\google\android-json\0.0.20131108.vaadin1\android-json-0.0.20131108.vaadin1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-core\5.3.31\spring-core-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-jcl\5.3.31\spring-jcl-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-test\5.3.31\spring-test-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\xmlunit\xmlunit-core\2.9.1\xmlunit-core-2.9.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-data-jpa\2.7.18\spring-boot-starter-data-jpa-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-jdbc\2.7.18\spring-boot-starter-jdbc-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\zaxxer\HikariCP\4.0.3\HikariCP-4.0.3.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-jdbc\5.3.31\spring-jdbc-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\jakarta\transaction\jakarta.transaction-api\1.3.3\jakarta.transaction-api-1.3.3.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\jakarta\persistence\jakarta.persistence-api\2.2.3\jakarta.persistence-api-2.2.3.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\hibernate\hibernate-core\5.6.15.Final\hibernate-core-5.6.15.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\jboss\jandex\2.4.2.Final\jandex-2.4.2.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\hibernate\common\hibernate-commons-annotations\5.1.2.Final\hibernate-commons-annotations-5.1.2.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\glassfish\jaxb\jaxb-runtime\2.3.9\jaxb-runtime-2.3.9.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\glassfish\jaxb\txw2\2.3.9\txw2-2.3.9.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\sun\istack\istack-commons-runtime\3.0.12\istack-commons-runtime-3.0.12.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\sun\activation\jakarta.activation\1.2.2\jakarta.activation-1.2.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\data\spring-data-jpa\2.7.18\spring-data-jpa-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\data\spring-data-commons\2.7.18\spring-data-commons-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-orm\5.3.31\spring-orm-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-aspects\5.3.31\spring-aspects-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\mysql\mysql-connector-j\8.0.33\mysql-connector-j-8.0.33.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-actuator\2.7.18\spring-boot-starter-actuator-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-actuator-autoconfigure\2.7.18\spring-boot-actuator-autoconfigure-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-actuator\2.7.18\spring-boot-actuator-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\micrometer\micrometer-core\1.11.5\micrometer-core-1.11.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\micrometer\micrometer-commons\1.11.5\micrometer-commons-1.11.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\micrometer\micrometer-observation\1.11.5\micrometer-observation-1.11.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\hdrhistogram\HdrHistogram\2.1.12\HdrHistogram-2.1.12.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\latencyutils\LatencyUtils\2.0.3\LatencyUtils-2.0.3.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\micrometer\micrometer-registry-prometheus\1.11.5\micrometer-registry-prometheus-1.11.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\prometheus\simpleclient_common\0.15.0\simpleclient_common-0.15.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\prometheus\simpleclient\0.15.0\simpleclient-0.15.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\prometheus\simpleclient_tracer_otel\0.15.0\simpleclient_tracer_otel-0.15.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\prometheus\simpleclient_tracer_common\0.15.0\simpleclient_tracer_common-0.15.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\prometheus\simpleclient_tracer_otel_agent\0.15.0\simpleclient_tracer_otel_agent-0.15.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\jsonwebtoken\jjwt-api\0.11.5\jjwt-api-0.11.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\jsonwebtoken\jjwt-impl\0.11.5\jjwt-impl-0.11.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\jsonwebtoken\jjwt-jackson\0.11.5\jjwt-jackson-0.11.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\fasterxml\jackson\core\jackson-databind\2.13.5\jackson-databind-2.13.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\fasterxml\jackson\core\jackson-annotations\2.13.5\jackson-annotations-2.13.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\fasterxml\jackson\core\jackson-core\2.13.5\jackson-core-2.13.5.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\grpc\grpc-netty-shaded\1.56.1\grpc-netty-shaded-1.56.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\guava\guava\31.1-android\guava-31.1-android.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\checkerframework\checker-qual\3.12.0\checker-qual-3.12.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\errorprone\error_prone_annotations\2.18.0\error_prone_annotations-2.18.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\perfmark\perfmark-api\0.26.0\perfmark-api-0.26.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\grpc\grpc-protobuf\1.56.1\grpc-protobuf-1.56.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\api\grpc\proto-google-common-protos\2.17.0\proto-google-common-protos-2.17.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\grpc\grpc-protobuf-lite\1.56.1\grpc-protobuf-lite-1.56.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\grpc\grpc-stub\1.56.1\grpc-stub-1.56.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\protobuf\protobuf-java\3.23.4\protobuf-java-3.23.4.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\devh\grpc-spring-boot-starter\2.14.0.RELEASE\grpc-spring-boot-starter-2.14.0.RELEASE.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\devh\grpc-server-spring-boot-starter\2.14.0.RELEASE\grpc-server-spring-boot-starter-2.14.0.RELEASE.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\devh\grpc-server-spring-boot-autoconfigure\2.14.0.RELEASE\grpc-server-spring-boot-autoconfigure-2.14.0.RELEASE.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\devh\grpc-common-spring-boot\2.14.0.RELEASE\grpc-common-spring-boot-2.14.0.RELEASE.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\grpc\grpc-core\1.51.0\grpc-core-1.51.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\code\gson\gson\2.9.1\gson-2.9.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\android\annotations\4.1.1.4\annotations-4.1.1.4.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\codehaus\mojo\animal-sniffer-annotations\1.21\animal-sniffer-annotations-1.21.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\grpc\grpc-services\1.51.0\grpc-services-1.51.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\google\protobuf\protobuf-java-util\3.21.7\protobuf-java-util-3.21.7.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\grpc\grpc-api\1.51.0\grpc-api-1.51.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\grpc\grpc-context\1.51.0\grpc-context-1.51.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\devh\grpc-client-spring-boot-starter\2.14.0.RELEASE\grpc-client-spring-boot-starter-2.14.0.RELEASE.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\net\devh\grpc-client-spring-boot-autoconfigure\2.14.0.RELEASE\grpc-client-spring-boot-autoconfigure-2.14.0.RELEASE.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\junit\junit\4.13.2\junit-4.13.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\hamcrest\hamcrest-core\2.2\hamcrest-core-2.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-data-cassandra\2.7.18\spring-boot-starter-data-cassandra-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\spring-tx\5.3.31\spring-tx-5.3.31.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\data\spring-data-cassandra\3.4.18\spring-data-cassandra-3.4.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\datastax\oss\java-driver-core\4.14.1\java-driver-core-4.14.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\datastax\oss\native-protocol\1.5.1\native-protocol-1.5.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\netty\netty-handler\4.1.101.Final\netty-handler-4.1.101.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\netty\netty-common\4.1.101.Final\netty-common-4.1.101.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\netty\netty-resolver\4.1.101.Final\netty-resolver-4.1.101.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\netty\netty-buffer\4.1.101.Final\netty-buffer-4.1.101.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\netty\netty-transport\4.1.101.Final\netty-transport-4.1.101.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\netty\netty-transport-native-unix-common\4.1.101.Final\netty-transport-native-unix-common-4.1.101.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\netty\netty-codec\4.1.101.Final\netty-codec-4.1.101.Final.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\datastax\oss\java-driver-shaded-guava\25.1-jre-graal-sub-1\java-driver-shaded-guava-25.1-jre-graal-sub-1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\typesafe\config\1.4.1\config-1.4.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\github\jnr\jnr-posix\3.1.15\jnr-posix-3.1.15.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\github\jnr\jnr-ffi\2.2.11\jnr-ffi-2.2.11.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\github\jnr\jffi\1.3.9\jffi-1.3.9.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\github\jnr\jffi\1.3.9\jffi-1.3.9-native.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\ow2\asm\asm-commons\9.2\asm-commons-9.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\ow2\asm\asm-analysis\9.2\asm-analysis-9.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\ow2\asm\asm-tree\9.2\asm-tree-9.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\ow2\asm\asm-util\9.2\asm-util-9.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\github\jnr\jnr-a64asm\1.0.0\jnr-a64asm-1.0.0.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\github\jnr\jnr-x86asm\1.0.2\jnr-x86asm-1.0.2.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\github\jnr\jnr-constants\0.10.3\jnr-constants-0.10.3.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\io\dropwizard\metrics\metrics-core\4.2.22\metrics-core-4.2.22.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\reactivestreams\reactive-streams\1.0.4\reactive-streams-1.0.4.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\github\stephenc\jcip\jcip-annotations\1.0-1\jcip-annotations-1.0-1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\github\spotbugs\spotbugs-annotations\3.1.12\spotbugs-annotations-3.1.12.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\com\datastax\oss\java-driver-query-builder\4.14.1\java-driver-query-builder-4.14.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\boot\spring-boot-starter-data-mongodb\2.7.18\spring-boot-starter-data-mongodb-2.7.18.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\mongodb\mongodb-driver-sync\4.6.1\mongodb-driver-sync-4.6.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\mongodb\bson\4.6.1\bson-4.6.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\mongodb\mongodb-driver-core\4.6.1\mongodb-driver-core-4.6.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\mongodb\bson-record-codec\4.6.1\bson-record-codec-4.6.1.jar;D:\Program Files\apache-maven-3.9.11-bin\apache-maven-3.9.11\repository\org\springframework\data\spring-data-mongodb\3.4.18\spring-data-mongodb-3.4.18.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.tplink.nbu.demo.basicspringboot.service.impl.UserServiceImplTest,testGetUser_CacheHit org.mockito.exceptions.verification.TooManyActualInvocations: userRepository.findById(1L); Wanted 1 time: -> at com.tplink.nbu.demo.basicspringboot.service.impl.UserServiceImplTest.testGetUser_CacheHit(UserServiceImplTest.java:382) But was 2 times: -> at com.tplink.nbu.demo.basicspringboot.service.impl.UserServiceImpl.getUser(UserServiceImpl.java:133) -> at com.tplink.nbu.demo.basicspringboot.service.impl.UserServiceImpl.getUser(UserServiceImpl.java:133) at com.tplink.nbu.demo.basicspringboot.service.impl.UserServiceImplTest.testGetUser_CacheHit(UserServiceImplTest.java:382) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.mockito.internal.runners.DefaultInternalRunner$1$1.evaluate(DefaultInternalRunner.java:55) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.mockito.internal.runners.DefaultInternalRunner$1.run(DefaultInternalRunner.java:100) at org.mockito.internal.runners.DefaultInternalRunner.run(DefaultInternalRunner.java:107) at org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:41) at org.mockito.junit.MockitoJUnitRunner.run(MockitoJUnitRunner.java:163) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)
最新发布
09-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值