Add from https://github.com/github/copilot-sdk-java/pull/233#1475
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Java unit test class exercising the session-map "re-key" cleanup paths in CopilotClient.createSession — i.e. the case where the server returns a different sessionId than the client supplied, plus the failure-after-rekey and no-rekey cases. The test stands up an in-process socket-based fake JSON-RPC server and uses reflection to inject a Connection into CopilotClient.
Changes:
- New
CreateSessionReKeyEntryTestwith an embeddedReKeyServersocket fake that replies tosession.createandsession.options.update. - Three test cases: successful re-key swaps the map key, failed
session.options.updateafter re-key removes both old and new keys, and matching ids leave a single entry. - Uses reflection to read the private
sessionsmap and to construct/inject the privateConnectionrecord viaconnectionFuture.
Show a summary per file
| File | Description |
|---|---|
| java/src/test/java/com/github/copilot/CreateSessionReKeyEntryTest.java | New reflection-based unit test covering session-id re-keying in CopilotClient.createSession. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
github/copilot-sdk-java#233