blob: e935962eac278ed7d04e826b80a6a1af761122ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package org.javacs;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.io.IOException;
import java.nio.file.Files;
import java.util.stream.Collectors;
import org.junit.Test;
public class ParserFixImportsTest {
@Test
public void findExistingImports() throws IOException {
var allJavaFiles =
Files.walk(JavaCompilerServiceTest.resourcesDir())
.filter(f -> f.getFileName().toString().endsWith(".java"))
.collect(Collectors.toSet());
assertThat(allJavaFiles, not(empty()));
var find = Parser.existingImports(allJavaFiles);
assertThat(find.classes, hasItem("java.util.List"));
assertThat(find.packages, hasItem("java.util"));
}
}
|