title: Testing Java code with Groovy under Intellij: unable to resolve class GroovyTestCase
body: <p>I need to write a short test for some Java code. I used CTRL+SHIFT+T to generate one with IntelliJ, and selected "Groovy JUnit" as the testing library, then wrote the following test:</p>
  
  <pre><code>package util
  class FibonacciHeapTest extends GroovyTestCase {
      FibonacciHeap&lt;Integer&gt; heap
  
      void setUp() {
          super.setUp()
          heap = new FibonacciHeap&lt;&gt;()
      }
  
      void testAddInOrder() {
          testForItems 1..1000
      }
  
  
      private void testForItems(Range&lt;Integer&gt; items) {
          items.each {heap &lt;&lt; it}
          assertEquals heap.size, items.to
          items.each {assertEquals heap.remove(), it}
      }
  }
  </code></pre>
  
  <p>However, when I right click on the test case in the project window, I don't get the "Run All Tests" option that I normally do with JUnit tests, and the compiler throws the following error: </p>
  
  <pre><code>Information:2/4/15 8:15 PM - Compilation completed with 2 errors and 0 warnings in 2 sec
  /home/patrick/IdeaProjects/hackerrank/src/test/java/util/FibonacciHeapTest.groovy
  Error:(3, 1) Groovyc: unable to resolve class util.FibonacciHeap
  Error:(9, 1) Groovyc: unable to resolve class GroovyTestCase
  </code></pre>
  
  <p>Trying to import <code>GroovyTestCase</code> or <code>FibonacciHeap</code> manually causes the same error. IntelliJ does not add any import statements when I let autocomplete finish the names for me, like it usually would with Java code. </p>
  
  <p>What am I doing wrong?</p>