Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No tests found for given includes: [closed]

I'm trying to run a simple test that's in my Test class from IDE (Intellij IDEA) and error that pops out is:

No tests found for given includes: org.sample.Test.test

Same thing is happening when I try to run it from command-line. In Intellij, I've set up Build, Execution, Deployment > Build Tools > Gradle > Runner to Gradle Test Runner and I have @Test on my method. Also, I can't run any test (from some other project), so I suppose that it's some configuration problem.

Can someone point me to something, what can I be doing wrong ?

like image 651
OGI Avatar asked Mar 01 '18 12:03

OGI


People also ask

What is filter includeTestsMatching?

includeTestsMatching. TestFilter includeTestsMatching​(String testNamePattern) Appends a test name pattern to the inclusion filter. Wildcard '*' is supported, either test method name or class name is supported. Examples of test names: "com.

How do I run a gradle test?

Run Gradle testsIn your Gradle project, in the editor, create or select a test to run. From the context menu, select Run <test name>. icon in the left gutter. If you selected the Choose per test option, IntelliJ IDEA displays both Gradle and JUnit test runners for each test in the editor.

What is useJUnitPlatform?

useJUnitPlatform() Specifies that JUnit Platform should be used to discover and execute the tests.


1 Answers

Ok, I've found an answer. On my Test class, I have @Category annotation. If I remove that one, my tests work, but I still don't know why. For example, on my colleague's IDE, same tests, but with @Category annotation work. It's a bit frustrating.

But, thanks for such a fast responses.

like image 121
OGI Avatar answered Nov 07 '22 05:11

OGI