title: "No tests found for given includes" when running Gradle tests in IntelliJ IDEA
body: <p>I cannot run tests via Gradle in IntelliJ IDEA because of "No tests found for given includes" error.</p>
  
  <p>How can I fix it?</p>
  
  <p>GradleTests</p>
  
  <pre class="lang-java prettyprint-override"><code>import org.junit.jupiter.api.Test;
  
  import static org.junit.jupiter.api.Assertions.assertTrue;
  
  public class GradleTests {
      @Test
      public void initTest() {
          assertTrue(true);
      }
  }
  </code></pre>
  
  <p>build.gradle</p>
  
  <pre><code>plugins {
      id 'java'
  }
  
  group 'org.example'
  version '1.0-SNAPSHOT'
  
  sourceCompatibility = 1.8
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      //testCompile group: 'junit', name: 'junit', version: '4.12'
  
      // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
      testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.6.0'
  }
  
  test {
      useJUnitPlatform()
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>&gt; Task :test FAILED
  FAILURE: Build failed with an exception.
  * What went wrong:
  Execution failed for task ':test'.
  &gt; No tests found for given includes: [GradleTests.initTest](filter.includeTestsMatching)
  </code></pre>
  
  <p>Some notes:</p>
  
  <ul>
  <li>Issue is reproduced with both JUnit 4 and 5</li>
  <li>IntelliJ IDEA 2019.3.3 (Community Edition), Build #IC-193.6494.35, built on February 11, 2020</li>
  <li>Test is in <code>src/test/java</code></li>
  <li>changing runner like <a href="https://stackoverflow.com/a/55417140/3520153">Intelij 2019.1 update breaks JUnit tests</a> didn't help</li>
  <li>without <code>useJUnitPlatform()</code> result is the same</li>
  </ul>