Test suite in class will not run "No tests were found"

Answered

Dowloaded project from githib

mvn clean install works fine. Tests run OK.

also mvn clean install install work from Maven Tool Window in Intellij.

on code windows I can click  on individual test and it will run fine.. (Only one test at a time)

But when I run all test in a testclass or package intellij shows red text "No tests were found"

Using Intellij Ultimate 2020.1

Was wondering if any one ran in to same issue?

 

I did Invalidate Cache and restart Intellij. Did not help.

 

Also Project Structure looks fine, Show tests in test/java folder

I did exclude vintage-engine from spring-boot-starter-test. Still did not fix issue

I realize this could be a IDE related issue but was wondering if you had seen this before.

0
11 comments

Please add the following dependencies:

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-engine</artifactId>
<version>1.6.0</version>
</dependency>
2

Worked like a charm!!! Thank you

1
Avatar
Permanently deleted user

The same issue. Above suggestion didn't work for me. 

0

Yash Bhatt 1494

Please share a sample project to reproduce this problem: https://uploads.jetbrains.com .

0

Whenever I run the test classes I get Caused by: org.junit.platform.commons.JUnitException: Failed to parse version of junit:junit: 3.8.1 error and changing the junit versions didn't help, any solution? Also the tests pass when I run the build from terminal but not when I individually run one class

 

Upload id: 2021_08_10_H64B7bXuVf94Zm5d (file: pom.xml)

0

Hello Patanupam4,

Please tell what IntelliJ IDEA version do you use? If possible please provide a sample project to reproduce the issue here: https://uploads.jetbrains.com .

Thanks

0

Hello, I am facing issue, any updates on this?

0

Hello,

Please create an issue in our bugtracker: https://youtrack.jetbrains.com/issues/IDEA

If possible please attach the sample project where the issue is reproduced for you.

Thank you 

0

Has a bug been opened on this?

The behavior I am seeing is that a @ParameterizedTest (with @MethodSource) will work fine.  But when I add a new parameter to the list of values, IntelliJ will not find any tests.  Running the test from the mvn command line shows the test passes as expected.
I am trying to whittle down all my company code to narrow a repro, but that is slow going.

If there is no bug, I can open one.  Just trying to avoid a duped report.

0

Hello John,

The bugs with `@ParameterizedTest` and `@MethodSource` should have been fixed in 2021.3 version (https://www.jetbrains.com/idea/nextversion). Please file a new bug in https://youtrack.jetbrains.com/issues/IDEA if you face one.

 

Thank you 

0

Please sign in to leave a comment.