报错信息:

Internal Error occurred.
org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-vintage' failed to discover testsat org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:111)at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:85)at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:92)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:69)at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.junit.platform.commons.JUnitException: MethodSelector [className = 'com..........Test', methodName = '.......', methodParameterTypes = ''] resolution failedat org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:102)at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:82)at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)at org.junit.vintage.engine.discovery.VintageDiscoverer.discover(VintageDiscoverer.java:44)at org.junit.vintage.engine.VintageTestEngine.discover(VintageTestEngine.java:63)at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:103)... 7 more
Caused by: org.junit.platform.commons.PreconditionViolationException: Could not load class with name: com...........Testat org.junit.platform.engine.discovery.MethodSelector.lambda$lazyLoadJavaClass$0(MethodSelector.java:157)at org.junit.platform.commons.function.Try$Failure.getOrThrow(Try.java:335)at org.junit.platform.engine.discovery.MethodSelector.lazyLoadJavaClass(MethodSelector.java:156)at org.junit.platform.engine.discovery.MethodSelector.getJavaClass(MethodSelector.java:135)at org.junit.vintage.engine.discovery.MethodSelectorResolver.resolve(MethodSelectorResolver.java:38)at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:146)at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359)at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:185)at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:125)at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:91)... 12 more
Caused by: java.lang.ClassNotFoundException: com.......Testat java.net.URLClassLoader.findClass(URLClassLoader.java:382)at java.lang.ClassLoader.loadClass(ClassLoader.java:424)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)at java.lang.ClassLoader.loadClass(ClassLoader.java:357)at org.junit.platform.commons.util.ReflectionUtils.lambda$tryToLoadClass$9(ReflectionUtils.java:792)at org.junit.platform.commons.function.Try.lambda$call$0(Try.java:57)at org.junit.platform.commons.function.Try.of(Try.java:93)at org.junit.platform.commons.function.Try.call(Try.java:57)at org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass(ReflectionUtils.java:755)at org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass(ReflectionUtils.java:711)... 28 more

背景:

非常正常的一个junit 测试类,别的@Test方法皆可正常运行,但是一加某个新的方法,就会报如上错误

项目是微服务项目,开发工具是idea, 一个workspace内导入多个service

解决方案:

根本错误是 ClassNotFoundException, 怀疑是有类似的名字的test文件,intellij无法准确找到,新开一个workSpace之后,单独导入这一个service,运行即可,怀疑是intellij抽风....但是切回原有workspace始终会有该问题,如果有朋友有更好解决方案,欢迎留言探讨~

JUnitException:Intellij unit test无法正常运行相关推荐

  1. 苹果手机图片黑白互换_苹果与3周显卡互换

    苹果手机图片黑白互换 Three weeks ago I was working on my iMac on a Saturday morning and the display went crazy ...

  2. 一起谈.NET技术,Visual Studio对程序集签名时一个很不好用的地方

    由于我们的项目底层使用到一个通过LogicalCallContext实现的上下文数据管理框架,导致所有的Unit Test不能正常运行.具体的现象在<只在UnitTest和WebHost中的出现 ...

  3. 使用intellij idea制作可执行jar文件

    可执行jar文件 一个可执行的 jar文件是一个自包含的 Java 应用程序,它存储在特别配置的 JAR 文件中,可以由 JVM 直接执行它而无需事先提取文件或者设置类路径.要运行存储在非可执行的 J ...

  4. idea新建项目写html5,Intellij IDEA搭建vue-cli项目

    1.安装/升级node环境 vue-cli对于node和npm的版本是有要求的. 可以通过 node -v (npm -v)查看当前版本,通过 where node (where npm)查看安装路径 ...

  5. intellij 打开node项目 一直停留在scanning files to index....,或跳出内存不够的提示框...

    说明: 在npm install 后,会出现Scanning files to index ...... 出现这个是正常的,但是一直不消失就不正常了.原因是npm install 后 node_mod ...

  6. 初识未来趋势:Java与Kotlin;EclipsE与IntelliJ

    Kotlin是JetBrains的一种新的编程语言.它首次出现在2011年,JetBrains推出了名为"科特林"的项目. Kotlin是开源语言. 基本上像Java一样,C和C ...

  7. intellij idea使用的准备工作

    设置内存大小 显示行号 注释不顶格 在idea中使用gradle进行编译编码gbk错误 设置Idea的方法注释模板 模版配置 设置idea的背景颜色 修改控制台背景颜色 命名转换插件 编码格式检查插件 ...

  8. 彻底解决 intellij IDEA 卡顿 优化笔记

    由于工作中经常出现分支各种切换,使用Eclipse便不再像以前那么舒服了,不停的修改工作空间,每次修改完工作空间又是一堆一堆的个性化设置,来回的切换,真的很累.我们做软件的,怎么能不去尝试新鲜的呢,毕 ...

  9. pdf 中的java运行,java - 从pdf文件读取特定位置的itext在intellij中运行,并提供所需的输出,但是可执行jar抛出错误 - 堆栈内存溢出...

    我正在从n个页面的输入pdf文件中读取特定位置,并在这些位置上列出文本. 然后,我编写一个新的pdf文档,并将列表中的这些字符串写入包含单元格的表中. 我提出了两个主要问题. 我想在表中有三列,但是如 ...

最新文章

  1. JaveWeb 公司项目(4)----- Easyui的表单验证
  2. concat拼接的坑 mysql_DNSlog注入踩坑记录:
  3. 代码夹带是洪水猛兽吗?
  4. php 查询数据库返回json数据
  5. SVM学习——在matlab上安装libsvm库(一)
  6. sqlmap 注入方式、使用总结
  7. css背景图background - 多背景定义
  8. IOS程序中打开自己的程序,测试机器中是否装了自己的程序(openURL:,canOpenURL:)
  9. Ibatis2.0使用说明(二)——配置篇
  10. IOT(8)---LoRa vs NB-IoT:12个角度看哪个物联网标准更具优势?
  11. Tomcat9版本不支持jsp处理PUT,DELETE之外的请求的解决方案(405方法不允许)
  12. [原创]RCP项目:邮件客户端
  13. 变分模态分解 python_Variational Mode Decomposition (变分模态分解)
  14. 信号处理中的预加重、去加重和均衡
  15. excel选中指定行数
  16. GIS方法类期刊和论文的综述(Introduction)怎么写?
  17. 技术人员在客户现场工作注意事项
  18. Spring Security系列(三)——WebFlux配置方式以及多登陆入口实现
  19. 计算机高级职称论文写什么题目,高级职称论文格式的要求
  20. 微信公众平台开发测试账号配置URL失败的问题

热门文章

  1. 实验(三):单片机I/O口实验-模拟开关灯
  2. 【六大设计原则-SOLID】
  3. 浅析C#Image类
  4. 每天一个Java知识点(spring-计划任务)
  5. react-router v6
  6. php校验苹果账号返回invalid_client
  7. 计组高分笔记:【06】计算机组成原理概述 「单总线 | 双总线 | 三总线 | 总线仲裁 | 总线标准 | 总线定时 | 同步定时 | 异步定时 | 半同步通信 | 分离式通信」
  8. QQ圈子:实名社交的潘多拉魔盒
  9. 程振波 算法设计与分析_算法设计与分析
  10. 常用oracle数据库查询命令