Skip to content

Commit ee560e4

Browse files
stephentoubCopilot
andcommitted
Fix Java close cancellation test after detach migration
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 3b7e09e commit ee560e4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ void testExternalToolCompletedCancelsBlockedHandler() throws Exception {
108108

109109
@Test
110110
void testCloseCancelsBlockedExternalTool() throws Exception {
111+
var rpc = mock(JsonRpcClient.class);
112+
when(rpc.invoke(eq("session.detach"), any(), eq(CopilotSession.SessionDetachResponse.class)))
113+
.thenReturn(CompletableFuture.completedFuture(new CopilotSession.SessionDetachResponse(true, null)));
114+
session = createTestSession(rpc);
111115
var toolFuture = new CompletableFuture<Object>();
112116
var started = new CountDownLatch(1);
113117
session.registerTools(List.of(ToolDefinition.create("blocked_tool", "Blocks", Map.of(), invocation -> {

0 commit comments

Comments
 (0)