JUnit Test exception occurred: Exception in thread "main" java.lang.NoSuchMethodError:org.junit.platform.commons.util.

Source: Internet
Author: User

Test exception occurs when unit tests are in progress

pom.xmldepend on the following

<Dependency>
<GroupId>org.junit.jupiter</GroupId>
<Artifactid>junit-jupiter-api</Artifactid>
<Version>release</Version>
</Dependency>

<Dependency>
<GroupId>junit</groupid ;
<artifactid >junit </artifactid ;
<version >4.3 </version ;
<scope >test < /scope ;
</dependency ;

cause of the problem
error in the pom.xml dependency, look closely at the console output and you will find that IntelliJ idea is trying to run my test case using JUNIT5.
/span>
com.intellij.junit5.JUnit5IdeaTestRunner.createListeners(JUnit5IdeaTestRunner.java:39)

By pom.xml discovering that I wanted to run the test case using JUnit4.12, we looked at the pom.xml discovery that junit-jupiter-api this dependency could lead to this error.

<dependency>    <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>RELEASE</version></dependency>


Solution Solutions

1. pom.xml Dependencies in org.junit.jupiter deletion
2. Reimport all Maven Project

  
    < span>                                                

JUnit Test exception occurred: Exception in thread "main" java.lang.NoSuchMethodError:org.junit.platform.commons.util.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.