feat: Add listConnections API (DEVX-10074)#297
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support in the Java SDK for the Video API “list connections in a session” endpoint (GET /v2/project/{apiKey}/session/{sessionId}/connection), exposing it via OpenTok.listConnections(sessionId) and validating behavior with WireMock-backed tests.
Changes:
- Introduces
ConnectionandConnectionListmodels to represent the API response. - Adds
HttpClient.listConnections(sessionId)and wires it into the publicOpenTok.listConnections(sessionId)API. - Adds a new unit/integration-style test to validate parsing, auth, and argument validation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/com/opentok/OpenTokTest.java | Adds WireMock stub + assertions for listConnections response parsing and request auth. |
| src/main/java/com/opentok/util/HttpClient.java | Implements the low-level GET call and status-code handling for listing connections. |
| src/main/java/com/opentok/OpenTok.java | Exposes listConnections as a public API and adds an ObjectReader for ConnectionList. |
| src/main/java/com/opentok/ConnectionList.java | New collection wrapper model for the list-connections response metadata + items. |
| src/main/java/com/opentok/Connection.java | New model representing a single connection and its state/timestamps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ce7b104 to
cce94ca
Compare
Add GET /v2/project/{apiKey}/session/{sessionId}/connection support:
- Connection model with connectionId, createdAt, connectionState (enum)
- ConnectionList response with count, applicationId, sessionId, items
- HttpClient.listConnections() method
- OpenTok.listConnections(sessionId) public API
- Tests with WireMock stub and validation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
cce94ca to
0195c90
Compare
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.
Add GET /v2/project/{apiKey}/session/{sessionId}/connection support: