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 ?
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.
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.
useJUnitPlatform() Specifies that JUnit Platform should be used to discover and execute the tests.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With