Skip to content

Commit 27c5fb5

Browse files
brunoborgesCopilot
andcommitted
Update src/test/java/com/github/copilot/sdk/CopilotSessionTest.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 46b8204 commit 27c5fb5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@ void testShouldReceiveSessionEvents_createAndDestroy() throws Exception {
8585
fail("Expected exception for closed session");
8686
} catch (Exception e) {
8787
// After our changes, we now get IllegalStateException directly
88-
assertTrue(e.getMessage().toLowerCase().contains("closed")
89-
|| (e.getCause() != null
90-
&& e.getCause().getMessage().toLowerCase().contains("not found")));
88+
String message = e.getMessage();
89+
String causeMessage = e.getCause() != null ? e.getCause().getMessage() : null;
90+
boolean matchesClosed = message != null && message.toLowerCase().contains("closed");
91+
boolean matchesNotFound = causeMessage != null && causeMessage.toLowerCase().contains("not found");
92+
assertTrue(matchesClosed || matchesNotFound);
9193
}
9294
}
9395
}

0 commit comments

Comments
 (0)