JUnit says my test method "could not be resolved to a unique method"
<p>Trying to learn JUnit 5 with IntelliJ IDEA. Created a test class and trying to test one method. Here's the message (see third line): </p>

<pre><code>INFO: Discovered TestEngines with IDs: [junit-jupiter]
Internal Error occurred.
org.junit.platform.commons.util.PreconditionViolationException:'DirectoryTest#directory2bytes' could not be resolved to a unique method
at org.junit.platform.engine.discovery.DiscoverySelectors.lambda$selectMethod$1(DiscoverySelectors.java:131)
at java.util.Optional.orElseThrow(Optional.java:290)
at org.junit.platform.engine.discovery.DiscoverySelectors.selectMethod(DiscoverySelectors.java:130)
at com.intellij.junit5.JUnit5TestRunnerUtil.createSelector(JUnit5TestRunnerUtil.java:111)
at com.intellij.junit5.JUnit5TestRunnerUtil.buildRequest(JUnit5TestRunnerUtil.java:86)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:46)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

Process finished with exit code 254
Empty test suite.
</code></pre>

<p>I can't understand why the method can't be resolved: It compiles and it's definitely there: </p>

<pre><code>@Test
void directory2bytes( ) {
    testBytes = testDir.directory2bytes();
    for( int i = 0; i &lt;= 10; i++) {
        System.out.print( testBytes[i] + " ")
    }
    System.out.println( );
}
</code></pre>

<p>And I have defined this: </p>

<pre><code>@BeforeEach
void setUp( ) {
    testDir = new Directory( )
    testBytes = new byte[1000];
}
</code></pre>

<p>Update: quitting and relaunching IntelliJ IDEA, I am now getting messages that the imported symbol "junit" can't be resolved, along with the various annotations "@beforeEach", "afterEach" and "Test". </p>

<p>Update 2: found and fixed a missing semicolon in test class, but no change. Note: there are compile errors in some of the classes that I'm not testing, but I have the test Run configuration set to "Build, no error check". Is this right? I have also tried to create the same test (with a different class name) using JUnit 4, but that doesn't work either. </p>

<p>Here are first few lines of error message: </p>

<pre><code>Dec 07, 2016 9:51:41 AM org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry loadTestEngines
INFO: Discovered TestEngines with IDs: [junit-jupiter, junit-vintage]
Internal Error occurred.
org.junit.platform.commons.util.PreconditionViolationException: Could not load class with name: DirectoryTest
at org.junit.platform.engine.discovery.MethodSelector.lambda$lazyLoadJavaClass$0(MethodSelector.java:154)
</code></pre>