File tree Expand file tree Collapse file tree
src/test/java/com/github/copilot/sdk Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments