Skip to content

Commit dc55c4e

Browse files
committed
feat: DeleteCall (soft) - soft delete call, verify not found
1 parent 8be37bb commit dc55c4e

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

src/test/java/io/getstream/VideoIntegrationTest.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,42 @@ void testCreateCallWithBackstageAndJoinAhead() throws Exception {
648648
assertEquals(0, updateResp2.getData().getCall().getJoinAheadTimeSeconds());
649649
}
650650

651+
@Test
652+
@Order(12)
653+
void testDeleteCall() throws Exception {
654+
// Create a call
655+
String callId = "test-call-" + RandomStringUtils.randomAlphabetic(8).toLowerCase();
656+
657+
video
658+
.getOrCreateCall(
659+
"default",
660+
callId,
661+
GetOrCreateCallRequest.builder()
662+
.data(CallRequest.builder().createdByID(testUsers.get(0).getId()).build())
663+
.build())
664+
.execute();
665+
666+
// Soft delete the call
667+
var deleteResp =
668+
video.deleteCall("default", callId, DeleteCallRequest.builder().build()).execute();
669+
670+
assertNotNull(deleteResp.getData());
671+
assertNotNull(deleteResp.getData().getCall());
672+
assertNull(deleteResp.getData().getTaskID());
673+
674+
// Verify the call is no longer found
675+
try {
676+
video.getCall("default", callId).execute();
677+
fail("Expected exception when getting deleted call");
678+
} catch (Exception e) {
679+
assertTrue(
680+
e.getMessage().contains("Can't find call with id")
681+
|| e.getMessage().contains("not found")
682+
|| e.getMessage().contains("404"),
683+
"Expected 'not found' error but got: " + e.getMessage());
684+
}
685+
}
686+
651687
@Test
652688
@Order(8)
653689
void testDeactivateUser() throws Exception {

0 commit comments

Comments
 (0)