Generate Unit tests with No Configuration and Mock everything outside the class for MoeListController
Expected behavior
Tests are supposed to be generated.
Actual behavior
Empty test class is generated.
Visual proofs
There's the following error in IDE logs.
| UtBot - UtTestsDialogProcessor | Generation complete
| UtBot - CodeGenerationController | Cannot render test class MoeListControllerTest
com.jetbrains.rd.util.reactive.RdFault: Can't find method openMocks(Ljava/lang/Object;)Ljava/lang/AutoCloseable; in org.mockito.MockitoAnnotations, reason: java.lang.IllegalStateException: Can't find method openMocks(Ljava/lang/Object;)Ljava/lang/AutoCloseable; in org.mockito.MockitoAnnotations
at org.utbot.framework.plugin.api.util.IdUtilKt.getMethod(IdUtil.kt:506)
at org.utbot.framework.plugin.api.MethodId.getModifiers(Api.kt:1337)
at org.utbot.framework.plugin.api.util.ModifierUtilKt.isStatic(ModifierUtil.kt:73)
at org.utbot.framework.codegen.tree.ConstructorUtilsKt.importIfNeeded(ConstructorUtils.kt:261)
at org.utbot.framework.codegen.tree.CgSpringUnitTestClassConstructor.constructAdditionalUtilMethods(CgSpringUnitTestClassConstructor.kt:59)
at org.utbot.framework.codegen.tree.CgAbstractSpringTestClassConstructor$constructTestClassBody$1.invoke(CgAbstractSpringTestClassConstructor.kt:52)
at org.utbot.framework.codegen.tree.CgAbstractSpringTestClassConstructor$constructTestClassBody$1.invoke(CgAbstractSpringTestClassConstructor.kt:27)
at org.utbot.framework.codegen.tree.BuildersKt.buildClassBody(Builders.kt:75)
at org.utbot.framework.codegen.tree.CgAbstractSpringTestClassConstructor.constructTestClassBody(CgAbstractSpringTestClassConstructor.kt:27)
at org.utbot.framework.codegen.tree.CgAbstractSpringTestClassConstructor.constructTestClassBody(CgAbstractSpringTestClassConstructor.kt:20)
at org.utbot.framework.codegen.tree.CgAbstractTestClassConstructor$constructTestClass$1.invoke(CgAbstractTestClassConstructor.kt:75)
at org.utbot.framework.codegen.tree.CgAbstractTestClassConstructor$constructTestClass$1.invoke(CgAbstractTestClassConstructor.kt:66)
at org.utbot.framework.codegen.tree.BuildersKt.buildClass(Builders.kt:64)
at org.utbot.framework.codegen.tree.CgAbstractTestClassConstructor.constructTestClass(CgAbstractTestClassConstructor.kt:66)
at org.utbot.framework.codegen.tree.CgAbstractTestClassConstructor$construct$1$1.invoke(CgAbstractTestClassConstructor.kt:57)
at org.utbot.framework.codegen.tree.CgAbstractTestClassConstructor$construct$1$1.invoke(CgAbstractTestClassConstructor.kt:57)
at org.utbot.framework.codegen.domain.context.CgContext.withTestClassScope(CgContext.kt:572)
at org.utbot.framework.codegen.tree.CgAbstractTestClassConstructor.withTestClassScope(CgAbstractTestClassConstructor.kt)
at org.utbot.framework.codegen.tree.CgAbstractTestClassConstructor$construct$1.invoke(CgAbstractTestClassConstructor.kt:57)
at org.utbot.framework.codegen.tree.CgAbstractTestClassConstructor$construct$1.invoke(CgAbstractTestClassConstructor.kt:56)
at org.utbot.framework.codegen.tree.BuildersKt.buildClassFile(Builders.kt:49)
at org.utbot.framework.codegen.tree.CgAbstractTestClassConstructor.construct(CgAbstractTestClassConstructor.kt:56)
at org.utbot.framework.codegen.generator.SpringCodeGenerator.generate(SpringCodeGenerator.kt:58)
at org.utbot.framework.codegen.generator.AbstractCodeGenerator$generateAsStringWithTestReport$1$1.invoke(AbstractCodeGenerator.kt:48)
at org.utbot.framework.codegen.generator.AbstractCodeGenerator$generateAsStringWithTestReport$1$1.invoke(AbstractCodeGenerator.kt:47)
at org.utbot.framework.codegen.domain.context.CgContext.withTestClassFileScope(CgContext.kt:562)
at org.utbot.framework.codegen.generator.AbstractCodeGenerator$generateAsStringWithTestReport$1.invoke(AbstractCodeGenerator.kt:47)
at org.utbot.framework.codegen.generator.AbstractCodeGenerator$generateAsStringWithTestReport$1.invoke(AbstractCodeGenerator.kt:46)
at org.utbot.framework.codegen.generator.AbstractCodeGenerator.withCustomContext(AbstractCodeGenerator.kt:75)
at org.utbot.framework.codegen.generator.AbstractCodeGenerator.generateAsStringWithTestReport(AbstractCodeGenerator.kt:46)
at org.utbot.framework.codegen.generator.AbstractCodeGenerator.generateAsStringWithTestReport$default(AbstractCodeGenerator.kt:41)
at org.utbot.framework.process.EngineProcessMainKt$setup$5.invoke(EngineProcessMain.kt:147)
at org.utbot.framework.process.EngineProcessMainKt$setup$5.invoke(EngineProcessMain.kt:144)
at org.utbot.rd.IdleWatchdog$measureTimeForActiveCall$1$2$1.invoke(ClientProcessUtil.kt:115)
at org.utbot.rd.IdleWatchdog.wrapActive(ClientProcessUtil.kt:88)
at org.utbot.rd.IdleWatchdog$measureTimeForActiveCall$1.invoke(ClientProcessUtil.kt:114)
at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182)
at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182)
at com.jetbrains.rd.framework.impl.RdCall.onWireReceived(RdTask.kt:362)
at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:57)
at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:56)
at com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:148)
at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:56)
at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:54)
at com.jetbrains.rd.util.threading.SingleThreadSchedulerBase.queue$lambda-3(SingleThreadScheduler.kt:41)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
at com.jetbrains.rd.framework.RdTaskResult$Companion.read(TaskInterfaces.kt:30) ~[?:?]
at com.jetbrains.rd.framework.impl.CallSiteWiredRdTask.onWireReceived(RdTask.kt:106) ~[?:?]
at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:57) ~[?:?]
at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:56) ~[?:?]
at com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:148) ~[?:?]
at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:56) ~[?:?]
at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:54) ~[?:?]
at com.jetbrains.rd.framework.impl.RdCall$createResponseScheduler$1.queue$execute(RdTask.kt:280) ~[?:?]
at com.jetbrains.rd.framework.impl.RdCall$createResponseScheduler$1.access$queue$execute(RdTask.kt:269) ~[?:?]
at com.jetbrains.rd.framework.impl.RdCall$createResponseScheduler$1$queue$1.invokeSuspend(RdTask.kt:289) ~[?:?]
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[?:?]
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[?:?]
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284) ~[?:?]
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) ~[?:?]
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59) ~[?:?]
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) ~[?:?]
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38) ~[?:?]
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) ~[?:?]
at org.utbot.rd.UtRdUtilKt.startBlocking(UtRdUtil.kt:31) ~[?:?]
at org.utbot.intellij.plugin.process.EngineProcess.render(EngineProcess.kt:274) ~[?:?]
at org.utbot.intellij.plugin.generator.CodeGenerationController$generateCodeAndReport$1.run(CodeGenerationController.kt:693) ~[?:?]
at org.utbot.intellij.plugin.util.IntelliJApiHelper$run$wrapper$1.run(IntelliJApiHelper.kt:42) ~[?:?]
at org.utbot.intellij.plugin.util.IntelliJApiHelper$run$3.run(IntelliJApiHelper.kt:49) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) ~[?:?]
at java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:399) [?:?]
at java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) [?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Description
Spring unit test code generation crashes when user has Mockito
2.1.0-beta.123
To Reproduce
MoeListController
Expected behavior
Tests are supposed to be generated.
Actual behavior
Empty test class is generated.
Visual proofs
There's the following error in IDE logs.