title: Unable to run JUnit 5 test in IntelliJ 2018.2.2 w/ Gradle 4.9
body: <p>I'm attempting to run a single JUnit 5 unit test from Intelli 2018.2.2 Community Edition. The project is using Gradle v4.9.</p>
  
  <p>For whatever reason, when attempting to run the test method individually or as a test class, the same output results:</p>
  
  <pre><code>Aug 29, 2018 3:37:47 PM 
  org.junit.platform.launcher.core.DefaultLauncher handleThrowable
  WARNING: TestEngine with ID 'junit-jupiter' failed to discover tests
  org.junit.platform.commons.util.PreconditionViolationException: Could not load class with name: MinHeapTest
  at org.junit.platform.engine.discovery.ClassSelector.lambda$getJavaClass$0(ClassSelector.java:73)
  at java.util.Optional.orElseThrow(Optional.java:290)
  at org.junit.platform.engine.discovery.ClassSelector.getJavaClass(ClassSelector.java:72)
  at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.lambda$resolve$3(DiscoverySelectorResolver.java:69)
  at java.util.ArrayList.forEach(ArrayList.java:1249)
  at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolve(DiscoverySelectorResolver.java:68)
  at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:50)
  at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:61)
  at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:130)
  at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:117)
  at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:82)
  at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:52)
  at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
  at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
  at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
  
  Aug 29, 2018 3:37:47 PM org.junit.platform.launcher.core.DefaultLauncher handleThrowable
  WARNING: TestEngine with ID 'junit-jupiter' failed to discover tests
  org.junit.platform.commons.util.PreconditionViolationException: Could not load class with name: MinHeapTest
  at org.junit.platform.engine.discovery.ClassSelector.lambda$getJavaClass$0(ClassSelector.java:73)
  at java.util.Optional.orElseThrow(Optional.java:290)
  at org.junit.platform.engine.discovery.ClassSelector.getJavaClass(ClassSelector.java:72)
  at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.lambda$resolve$3(DiscoverySelectorResolver.java:69)
  at java.util.ArrayList.forEach(ArrayList.java:1249)
  at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolve(DiscoverySelectorResolver.java:68)
  at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:50)
  at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:61)
  at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:130)
  at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:117)
  at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
  at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:74)
  at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
  at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
  at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
  
  
  Process finished with exit code 0
  Empty test suite.
  </code></pre>
  
  <p>Running <code>gradle test</code> on the command line runs just fine. </p>
  
  <p>The Gradle configuration is:
      apply plugin: 'java'</p>
  
  <pre><code>repositories {
      jcenter()
  }
  
  dependencies {
      testCompile("org.junit.jupiter:junit-jupiter-api:5.2.0")
      testRuntime("org.junit.jupiter:junit-jupiter-engine:5.2.0")
  }
  
  test {
      useJUnitPlatform()
  }
  </code></pre>
  
  <p>I've read about vaguely similar issues w/ IntelliJ 2016, but not more recent builds. </p>
  
  <p>Anyone else run into this issue? Seems like InteliJ is using some other means to launch the tests than Gradle, but its unclear what. </p>
  
  <p>For good measure, I checked <a href="https://youtrack.jetbrains.com/issues?q=%22org.junit.platform.commons.util.PreconditionViolationException:%20Could%20not%20load%20class%20with%20name:%22" rel="nofollow noreferrer">YouTrack</a> for similar stack traces to no avail.</p>
  
  <p>Pointers appreciated!</p>