JUnit 测试类不是由 diffblue intellij 生成的

问题描述 投票:0回答:2

我在 intelliJ IDE 中安装了 diffblue 插件,并使用 java 11 项目进行了 Spring Boot。在这里,我尝试为一个服务类生成测试类/案例。

    @Service
    public class MyService {
        @Autowired
        OrderRepo orderRepo;
        @Autowired
        ProductRepo productRepo;
    
    
    @Transactional(rollbackFor = Exception.class)
    public Order mapping() throws Exception {
        Order order = new Order();
        order.setOrderDate(new Date());
        order.setTransaction(new Transaction(new Date(), 11.0, order));
        order.setOrderItems(Arrays.asList(new OrderItem(order), new OrderItem(order), new OrderItem(order)));

        Product p=productRepo.save(new Product(1, "P1"));
        Order o=orderRepo.save(order);
        boolean b=checkOrder(o);
        return o;
    }
}

当尝试从 diffblue 图标生成测试用例时,它没有生成。消息为:

Tests written: 0
Cover was unable to write any tests for the reasons listed below.
Change what sort of tests Cover writes in **Change Settings**.
Methods without tests: 1
Diffblue AI was unable to find a test: 1

日志:

--monitoring-service-port 54013 --debug-log
18:56:26.010 [INFO]  [Creating] Server started. Waiting up to 300 seconds for a connection to be established...
18:56:42.979 [INFO]  [Creating] Starting new remote monitor client
18:56:55.299 [INFO]  [Creating] Attempting to start remote server.
18:56:58.951 [INFO]  [Creating] Server started, listening on localhost/127.0.0.1:54028
18:57:00.046 [INFO]  [Creating] Expect analyzer service to be listening on port 54028.
18:57:06.357 [INFO]  [Creating] Started analyzer service and client retrieved.
18:58:04.361 [INFO]  [Creating] 
================================================================================
= Creating tests for 'com.spring.controller.MyController.batchProcessing:()V' using 'SCo[SB] (sp, !fnm, df, !ris)'
================================================================================
19:03:08.041 [INFO]  [Creating] Service shutdown due to watchdog timeout
19:03:08.215 [INFO]  [Creating] 
== begin thread dump ==

27 threads

Thread 1 'main':
  [email protected]/java.lang.Thread.dumpThreads(Native Method)
  [email protected]/java.lang.Thread.getAllStackTraces(Thread.java:1657)
  com.diffblue.cover.service.a.a.a.d(SourceFile:1164)
  com.diffblue.cover.service.a.a.b.a(SourceFile:151)
  com.diffblue.cover.service.analyzer.Main.main(SourceFile:46)
  [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [email protected]/java.lang.reflect.Method.invoke(Method.java:566)
  com.diffblue.cover.launcher.Launcher.invokeMainMethod(Launcher.java:116)
  com.diffblue.cover.launcher.Launcher.main(Launcher.java:72)
Thread 2728 'ClassGraph-worker-15':
  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
  [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
  [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
  [email protected]/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 26 'grpc-default-executor-2':
  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
  [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
  [email protected]/java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:462)
  [email protected]/java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:361)
  [email protected]/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1053)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 2729 'grpc-default-executor-3':
  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
  [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
  [email protected]/java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:462)
  [email protected]/java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:361)
  [email protected]/java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1053)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 2721 'ClassGraph-worker-8':
  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
  [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
  [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
  [email protected]/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 2723 'ClassGraph-worker-10':
  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
  [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
  [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
  [email protected]/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 16 'grpc-nio-worker-ELG-1-2':
  [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
  [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:357)
  [email protected]/sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:182)
  [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:124)
  [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:141)
  io.grpc.netty.shaded.io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SourceFile:68)
  io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.select(SourceFile:813)
  io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(SourceFile:460)
  io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SourceFile:997)
  io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(SourceFile:74)
  io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(SourceFile:30)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 2727 'ClassGraph-worker-14':
  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
  [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
  [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
  [email protected]/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 11 'Common-Cleaner':
  [email protected]/java.lang.Object.wait(Native Method)
  [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
  [email protected]/jdk.internal.ref.CleanerImpl.run(CleanerImpl.java:148)
  [email protected]/java.lang.Thread.run(Thread.java:834)
  [email protected]/jdk.internal.misc.InnocuousThread.run(InnocuousThread.java:134)
Thread 2722 'ClassGraph-worker-9':
  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
  [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
  [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
  [email protected]/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 5 'Attach Listener':
Thread 13 'logback-1':
  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
  [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
  [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
  [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1170)
  [email protected]/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 12 'Service log dispatcher':
  [email protected]/sun.nio.ch.WindowsSelectorImpl.setWakeupSocket0(Native Method)
  [email protected]/sun.nio.ch.WindowsSelectorImpl.setWakeupSocket(WindowsSelectorImpl.java:504)
  [email protected]/sun.nio.ch.WindowsSelectorImpl.wakeup(WindowsSelectorImpl.java:625)
  io.grpc.netty.shaded.io.netty.channel.nio.SelectedSelectionKeySetSelector.wakeup(SourceFile:73)
  io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.wakeup(SourceFile:787)
  io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.execute(SourceFile:857)
  io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.execute0(SourceFile:827)
  io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.execute(SourceFile:817)
  io.grpc.netty.shaded.io.grpc.netty.NettyClientStream$TransportState.runOnTransportThread(SourceFile:321)
  io.grpc.internal.AbstractStream$TransportState.requestMessagesFromDeframer(SourceFile:245)
  io.grpc.internal.AbstractStream$TransportState.access$000(SourceFile:111)
  io.grpc.internal.AbstractStream.request(SourceFile:57)
  io.grpc.internal.ForwardingClientStream.request(SourceFile:32)
  io.grpc.internal.RetriableStream$1RequestEntry.runWith(SourceFile:574)
  io.grpc.internal.RetriableStream.delayOrExecute(SourceFile:529)
  io.grpc.internal.RetriableStream.request(SourceFile:578)
  io.grpc.internal.ClientCallImpl.request(SourceFile:440)
  io.grpc.stub.ClientCalls$UnaryStreamToFuture.onStart(SourceFile:550)
  io.grpc.stub.ClientCalls.startCall(SourceFile:342)
  io.grpc.stub.ClientCalls.asyncUnaryRequestCall(SourceFile:315)
  io.grpc.stub.ClientCalls.futureUnaryCall(SourceFile:227)
  com.diffblue.cover.service.a.b.a.a(SourceFile:1440)
  com.diffblue.cover.logging.RemoteLogAppender$a.run(SourceFile:204)
Thread 17 'grpc-default-executor-0':
  [email protected]/java.lang.Object.wait(Native Method)
  [email protected]/java.lang.Thread.join(Thread.java:1305)
  [email protected]/java.lang.Thread.join(Thread.java:1379)
  com.diffblue.cover.sandbox.execution.WorkerThread.callWorkerThread(SourceFile:155)
  com.diffblue.cover.sandbox.a.a.a(SourceFile:61)
  com.diffblue.fuzztest.f.c.r(SourceFile:425)
  com.diffblue.fuzztest.f.c$$Lambda$389/0x00000001005a1440.call(Unknown Source)
  com.diffblue.cover.sandbox.execution.WrapExceptionsInBaseException.handleException(SourceFile:57)
  com.diffblue.cover.sandbox.execution.WrapThrowableInBaseException.lambda$run$0(SourceFile:23)
  com.diffblue.cover.sandbox.execution.WrapThrowableInBaseException$$Lambda$264/0x0000000100499440.call(Unknown Source)
  com.diffblue.cover.sandbox.execution.WrapThrowableInBaseException.handleThrowable(SourceFile:34)
  com.diffblue.cover.sandbox.execution.WrapThrowableInBaseException.run(SourceFile:23)
  com.diffblue.fuzztest.f.c.d(SourceFile:424)
  com.diffblue.fuzztest.f.t.d(SourceFile:136)
  com.diffblue.cover.analysis.a.b$a$$Lambda$388/0x00000001005a1040.get(Unknown Source)
  com.diffblue.cover.analysis.a.b$a.a(SourceFile:99)
  com.diffblue.cover.analysis.a.b$a.tryAdvance(SourceFile:246)
  com.diffblue.cover.service.analyzer.a.c$a.a(SourceFile:2037)
  com.diffblue.cover.service.analyzer.a.a.i$h.invoke(SourceFile:638)
  io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(SourceFile:182)
  io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(SourceFile:355)
  io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(SourceFile:867)
  io.grpc.internal.ContextRunnable.run(SourceFile:37)
  io.grpc.internal.SerializingExecutor.run(SourceFile:133)
  [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
  [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 2731 'TimedExecutor-9':
  [email protected]/java.lang.StackTraceElement.initStackTraceElements(Native Method)
  [email protected]/java.lang.StackTraceElement.of(StackTraceElement.java:526)
  [email protected]/java.lang.Throwable.getOurStackTrace(Throwable.java:828)
  [email protected]/java.lang.Throwable.getStackTrace(Throwable.java:820)
  org.mockito.internal.exceptions.stacktrace.StackTraceFilter.filterFirst(StackTraceFilter.java:109)
  org.mockito.internal.debugging.LocationImpl.computeStackTraceInformation(LocationImpl.java:50)
  org.mockito.internal.debugging.LocationImpl.<init>(LocationImpl.java:35)
  org.mockito.internal.debugging.LocationImpl.<init>(LocationImpl.java:26)
  org.mockito.internal.debugging.LocationImpl.<init>(LocationImpl.java:22)
  org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:56)
  org.mockito.internal.creation.bytebuddy.MockMethodInterceptor$DispatcherDefaultingToRealMethod.interceptAbstract(MockMethodInterceptor.java:161)
  org.mockito.codegen.ProductRepo$MockitoMock$iJkinF5x.save(Unknown Source)
  org.mockito.codegen.ProductRepo$MockitoMock$iJkinF5x.save(Unknown Source)
  com.spring.service.MyService.batchProcessing(MyService.java:89)
  com.spring.controller.MyController.batchProcessing(MyController.java:27)
  [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [email protected]/java.lang.reflect.Method.invoke(Method.java:566)
  org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
  org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
  org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
  org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
  org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072)
  org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
  org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:529)
  org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
  org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:72)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
  org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:167)
  org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:134)
  org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:201)
  [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [email protected]/java.lang.reflect.Method.invoke(Method.java:566)
  com.diffblue.tir.a.h.a(SourceFile:78)
  com.diffblue.tir.a.a.e.a(SourceFile:741)
  com.diffblue.tir.a.f.a(SourceFile:421)
  com.diffblue.tir.a.f.b(SourceFile:80)
  com.diffblue.tir.d.e.a(SourceFile:38)
  com.diffblue.tir.a.g.a(SourceFile:221)
  com.diffblue.tir.a.g.b(SourceFile:88)
  com.diffblue.tir.a.g$$Lambda$1283/0x000000010094f040.call(Unknown Source)
  com.diffblue.cover.sandbox.execution.SafeTimedExecutor$$Lambda$654/0x000000010063b040.call(Unknown Source)
  com.diffblue.cover.sandbox.execution.TimedCallableExecutor$CallableFuture.executeTask(SourceFile:28)
  com.diffblue.cover.sandbox.execution.TimedExecutor$TaskQueueRunner.run(SourceFile:78)
  com.diffblue.cover.sandbox.execution.WorkerThread.run(SourceFile:216)
Thread 18 'grpc-nio-boss-ELG-3-1':
  [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
  [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:357)
  [email protected]/sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:182)
  [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:124)
  [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:141)
  io.grpc.netty.shaded.io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SourceFile:68)
  io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.select(SourceFile:813)
  io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(SourceFile:460)
  io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SourceFile:997)
  io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(SourceFile:74)
  io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(SourceFile:30)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 3 'Finalizer':
  [email protected]/java.lang.Object.wait(Native Method)
  [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
  [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:176)
  [email protected]/java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:170)
Thread 2725 'ClassGraph-worker-12':
  [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
  [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
  [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)

  **removed due to limit**
  io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SourceFile:997)
  io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(SourceFile:74)
  io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(SourceFile:30)
  [email protected]/java.lang.Thread.run(Thread.java:834)
Thread 4 'Signal Dispatcher':
Thread 15 'grpc-nio-worker-ELG-1-1':
  [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
  [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:357)
  [email protected]/sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:182)
  [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:124)
  [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:136)
  io.grpc.netty.shaded.io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SourceFile:62)
  io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.select(SourceFile:817)
  io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(SourceFile:460)
  io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SourceFile:997)
  io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(SourceFile:74)
  io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(SourceFile:30)
  [email protected]/java.lang.Thread.run(Thread.java:834)
== end thread dump ==

19:03:10.150 [INFO]  [Creating] Exiting service.
19:03:18.401 [INFO]  [Creating]     [1/1] com.spring.controller.MyController.batchProcessing
19:03:18.401 [INFO]  [Creating]     [1/1]   Diffblue AI was unable to find a test
19:03:18.435 [INFO]  [Creating] [1/1] com.spring.controller.MyController
19:03:18.435 [INFO]  [Creating] [1/1]   Tests created: 0
19:03:19.179 [INFO]  [Reporting] 
19:03:19.179 [INFO]  [Reporting] Summary:
19:03:19.179 [INFO]  [Reporting] --------
19:03:19.179 [INFO]  [Reporting] Total:                                               1 method
19:03:19.180 [INFO]  [Reporting] 
19:03:19.180 [INFO]  [Reporting] No tests created for:                                1 method
19:03:28.675 [INFO]  [Reporting] License doesn't allow multiple classes
19:03:28.693 [INFO]  [Reporting] License doesn't allow creating report.json

需要什么特殊设置吗?我正在使用所有社区版本。

java spring-boot intellij-idea spring-test intellij-plugin
2个回答
0
投票

转到设置并选择 junit 4 或 junit 5 并设置测试类型 Brief


0
投票

日志输出和发送的代码之间的方法/类不匹配:

代码:

MyService.mapping()

日志:

Creating tests for 'com.spring.controller.MyController.batchProcessing:()V'

无论如何,请尝试更新到最新版本的 Diffblue Cover。去年,在为 Spring 编写测试方面有了很多改进,因此您很可能会看到改进! 如果您在最新版本的 Cover 中仍然看到问题,那么您是否能够显示日志文件 - 我们应该看到更多信息的输出。

注意;您必须使用最新版本的 IntelliJ 才能访问最新版本的 Cover

© www.soinside.com 2019 - 2024. All rights reserved.