Skip to content

Commit 25829a4

Browse files
brunoborgesCopilot
andauthored
Update src/test/java/com/github/copilot/sdk/ThreadFactoryProviderTest.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent af2540d commit 25829a4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/test/java/com/github/copilot/sdk/ThreadFactoryProviderTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,16 @@ void newSingleThreadExecutorRunsTask() throws Exception {
5050

5151
@Test
5252
void isVirtualThreadsReturnsBoolean() {
53-
// On Java 17 this returns false; on Java 21+ it returns true.
54-
// We just verify it doesn't throw.
53+
// Unit tests run against exploded classes rather than the packaged
54+
// multi-release JAR, so Java 21+ may still load the base implementation
55+
// and report false here. Verify only behavior that does not depend on
56+
// multi-release class selection.
5557
boolean result = ThreadFactoryProvider.isVirtualThreads();
5658
int javaVersion = Runtime.version().feature();
57-
if (javaVersion >= 21) {
58-
assertTrue(result, "Expected virtual threads on Java 21+");
59-
} else {
59+
if (javaVersion < 21) {
6060
assertFalse(result, "Expected platform threads on Java < 21");
61+
} else if (result) {
62+
assertTrue(javaVersion >= 21, "Virtual threads are only supported on Java 21+");
6163
}
6264
}
6365
}

0 commit comments

Comments
 (0)