Skip to content

Commit 2e12f95

Browse files
committed
Enhance test method names and documentation across multiple test classes for clarity and consistency
1 parent 15d6371 commit 2e12f95

10 files changed

Lines changed: 484 additions & 82 deletions

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ static void teardown() throws Exception {
4444
}
4545
}
4646

47+
/**
48+
* Verifies that user input handler is invoked when model uses ask_user tool.
49+
*
50+
* @see Snapshot:
51+
* ask_user/should_invoke_user_input_handler_when_model_uses_ask_user_tool
52+
*/
4753
@Test
48-
void testUserInputHandlerInvokedWhenModelUsesAskUserTool() throws Exception {
54+
void testShouldInvokeUserInputHandlerWhenModelUsesAskUserTool() throws Exception {
4955
ctx.configureForTest("ask_user", "should_invoke_user_input_handler_when_model_uses_ask_user_tool");
5056

5157
List<UserInputRequest> userInputRequests = new ArrayList<>();
@@ -82,8 +88,13 @@ void testUserInputHandlerInvokedWhenModelUsesAskUserTool() throws Exception {
8288
}
8389
}
8490

91+
/**
92+
* Verifies that choices are received in user input requests.
93+
*
94+
* @see Snapshot: ask_user/should_receive_choices_in_user_input_request
95+
*/
8596
@Test
86-
void testUserInputRequestWithChoices() throws Exception {
97+
void testShouldReceiveChoicesInUserInputRequest() throws Exception {
8798
ctx.configureForTest("ask_user", "should_receive_choices_in_user_input_request");
8899

89100
List<UserInputRequest> userInputRequests = new ArrayList<>();
@@ -116,10 +127,12 @@ void testUserInputRequestWithChoices() throws Exception {
116127
}
117128

118129
/**
119-
* Test for freeform user input response.
130+
* Verifies that freeform user input responses are handled.
131+
*
132+
* @see Snapshot: ask_user/should_handle_freeform_user_input_response
120133
*/
121134
@Test
122-
void testFreeformUserInputResponse() throws Exception {
135+
void testShouldHandleFreeformUserInputResponse() throws Exception {
123136
ctx.configureForTest("ask_user", "should_handle_freeform_user_input_response");
124137

125138
final List<UserInputRequest> userInputRequests = new ArrayList<>();

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ static void teardown() throws Exception {
4848
}
4949
}
5050

51+
/**
52+
* Verifies that compaction is triggered with low threshold and emits events.
53+
*
54+
* @see Snapshot:
55+
* compaction/should_trigger_compaction_with_low_threshold_and_emit_events
56+
*/
5157
@Test
5258
@Timeout(value = 120, unit = TimeUnit.SECONDS)
53-
void testTriggerCompactionWithLowThresholdAndEmitEvents() throws Exception {
59+
void testShouldTriggerCompactionWithLowThresholdAndEmitEvents() throws Exception {
5460
ctx.configureForTest("compaction", "should_trigger_compaction_with_low_threshold_and_emit_events");
5561

5662
// Create session with very low compaction thresholds to trigger compaction
@@ -114,8 +120,15 @@ void testTriggerCompactionWithLowThresholdAndEmitEvents() throws Exception {
114120
}
115121
}
116122

123+
/**
124+
* Verifies that compaction events are not emitted when infinite sessions is
125+
* disabled.
126+
*
127+
* @see Snapshot:
128+
* compaction/should_not_emit_compaction_events_when_infinite_sessions_disabled
129+
*/
117130
@Test
118-
void testNotEmitCompactionEventsWhenInfiniteSessionsDisabled() throws Exception {
131+
void testShouldNotEmitCompactionEventsWhenInfiniteSessionsDisabled() throws Exception {
119132
ctx.configureForTest("compaction", "should_not_emit_compaction_events_when_infinite_sessions_disabled");
120133

121134
InfiniteSessionConfig infiniteConfig = new InfiniteSessionConfig().setEnabled(false);

0 commit comments

Comments
 (0)