Skip to content

Commit 1ca58db

Browse files
committed
Fix unit test
1 parent 52dd4d2 commit 1ca58db

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/commands/WorkspaceBootExecutableProjectsTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,16 @@ void multipleProjects() throws Exception {
9797
assertNotNull(res);
9898
assertEquals(2, res.size());
9999

100-
ExecutableProject execProject2 = res.get(0);
100+
ExecutableProject execProject1 = res.stream().filter(p -> "test-spring-indexing".equals(p.name())).findFirst().orElseThrow();
101+
assertEquals("test-spring-indexing", execProject1.name());
102+
assertEquals("org.test.MainClass", execProject1.mainClass());
103+
assertEquals(project1.getLocationUri().toASCIIString(), execProject1.uri());
104+
assertEquals("com.example:test-spring-indexing:0.0.1-SNAPSHOT", execProject1.gav());
105+
assertEquals(99, execProject1.classpath().size());
106+
assertTrue(execProject1.classpath().stream().map(path -> Path.of(path)).anyMatch(p -> p.endsWith("target/classes")));
107+
assertFalse(execProject1.classpath().stream().map(path -> Path.of(path)).anyMatch(p -> p.endsWith("target/test-classes")));
108+
109+
ExecutableProject execProject2 = res.stream().filter(p -> "test-spring-data-symbols".equals(p.name())).findFirst().orElseThrow();
101110
assertEquals("test-spring-data-symbols", execProject2.name());
102111
assertEquals("org.test.Application", execProject2.mainClass());
103112
assertEquals(project2.getLocationUri().toASCIIString(), execProject2.uri());
@@ -106,14 +115,6 @@ void multipleProjects() throws Exception {
106115
assertTrue(execProject2.classpath().stream().map(path -> Path.of(path)).anyMatch(p -> p.endsWith("target/classes")));
107116
assertFalse(execProject2.classpath().stream().map(path -> Path.of(path)).anyMatch(p -> p.endsWith("target/test-classes")));
108117

109-
ExecutableProject execProject1 = res.get(1);
110-
assertEquals("test-spring-indexing", execProject1.name());
111-
assertEquals("org.test.MainClass", execProject1.mainClass());
112-
assertEquals(project1.getLocationUri().toASCIIString(), execProject1.uri());
113-
assertEquals("com.example:test-spring-indexing:0.0.1-SNAPSHOT", execProject1.gav());
114-
assertEquals(99, execProject1.classpath().size());
115-
assertTrue(execProject1.classpath().stream().map(path -> Path.of(path)).anyMatch(p -> p.endsWith("target/classes")));
116-
assertFalse(execProject1.classpath().stream().map(path -> Path.of(path)).anyMatch(p -> p.endsWith("target/test-classes")));
117118
}
118119

119120
}

0 commit comments

Comments
 (0)