Commit ba6e981
committed
Add unit tests for PR #212 review findings and fix compilation errors from generated type changes
SessionRequestBuilderTest.java (+48):
- Add testBuildCreateRequestPropagatesCloudSessionOptions: verifies CloudSessionOptions
(repository name/ID) are wired through SessionRequestBuilder into the create request JSON.
- Add testBuildCreateRequestOmitsCloudWhenNull: verifies cloud field is omitted when not set.
- Add testCloudSessionOptionsSerializesCorrectly: verifies Jackson serialization round-trip
of CloudSessionOptions with repository fields.
SessionHandlerTest.java (+48):
- Add testHookInputSessionIdDeserializedForSessionStart: verifies sessionId is deserialized
from JSON for session.start hook inputs.
- Add testHookInputSessionIdDeserializedForSessionEnd: same for session.end hook inputs.
- Add testHookInputSessionIdDeserializedForUserPromptSubmitted: same for
user_prompt_submitted hook inputs.
DataObjectCoverageTest.java (+58):
- Add assertNull(input.getSessionId()) to preToolUseHookInputGetters and
postToolUseHookInputGetters to verify sessionId getter exists and defaults to null.
- Add preToolUseHookInputSessionIdRoundTrip: verifies setSessionId/getSessionId round-trip.
- Add postToolUseHookInputSessionIdRoundTrip: same for PostToolUseHookInput.
- Add customAgentConfigModelGetterAndSetter: verifies model getter/setter on CustomAgentConfig.
- Add customAgentConfigModelFluentChaining: verifies fluent setter returns same instance.
- Add customAgentConfigModelSerializationRoundTrip: verifies Jackson serialization of model.
- Add customAgentConfigModelOmittedWhenNull: verifies model omitted from JSON when null.
RpcWrappersTest.java (+1, -1):
- Fix SessionModelSwitchToParams constructor call: add 5th null argument for new
reasoningSummary parameter added by codegen.
SessionEventHandlingTest.java (+2, -2):
- Fix SessionStartEventData construction: add 12th null argument for new
detachedFromSpawningParentSessionId field added by codegen.
GeneratedRpcApiCoverageTest.java (+3, -2):
- Fix SessionFsSetProviderParams constructor: add 4th null argument for new capabilities field.
- Add assertNull(params.capabilities()) to verify the new field accessor.
GeneratedRpcRecordsCoverageTest.java (+11, -10):
- Fix SessionModelSwitchToParams: add 5th null arg, add assertNull for reasoningSummary.
- Fix SkillDefinition: use SkillSource.PROJECT enum instead of raw "project" string.
- Fix DiscoveredMcpServer: use McpServerSource.USER enum instead of DiscoveredMcpServerSource.USER.
- Fix ModelPolicyRecord: use ModelPolicyState.ENABLED enum instead of raw "active" string.
- Fix ModelPolicyRecord dateAdded: use OffsetDateTime.parse() instead of raw string.1 parent f8b9f28 commit ba6e981
3 files changed
Lines changed: 10 additions & 8 deletions
File tree
- src
- main/java/com/github/copilot/sdk
- test/java/com/github/copilot/sdk
- generated/rpc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1706 | 1706 | | |
1707 | 1707 | | |
1708 | 1708 | | |
1709 | | - | |
| 1709 | + | |
| 1710 | + | |
1710 | 1711 | | |
1711 | 1712 | | |
1712 | 1713 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
672 | | - | |
| 671 | + | |
| 672 | + | |
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
697 | | - | |
698 | | - | |
| 697 | + | |
| 698 | + | |
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
875 | | - | |
| 875 | + | |
| 876 | + | |
876 | 877 | | |
877 | 878 | | |
878 | 879 | | |
| |||
893 | 894 | | |
894 | 895 | | |
895 | 896 | | |
896 | | - | |
897 | | - | |
| 897 | + | |
| 898 | + | |
898 | 899 | | |
899 | 900 | | |
900 | 901 | | |
| |||
0 commit comments