Skip to content

Commit 8be37bb

Browse files
committed
feat: CreateCallWithBackstageAndJoinAhead video integration test
1 parent 37c3dd5 commit 8be37bb

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

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

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,82 @@ void testUserBlocking() throws Exception {
572572
assertFalse(stillFoundBob, "Bob should no longer be in alice's blocked list");
573573
}
574574

575+
@Test
576+
@Order(11)
577+
void testCreateCallWithBackstageAndJoinAhead() throws Exception {
578+
// Create a call with backstage enabled and join_ahead_time_seconds = 300
579+
String callId = "test-call-" + RandomStringUtils.randomAlphabetic(8).toLowerCase();
580+
createdCallIds.add(callId);
581+
582+
String userId = testUsers.get(0).getId();
583+
long startsAtMs = System.currentTimeMillis() + 30 * 60 * 1000; // 30 minutes from now
584+
585+
var createResp =
586+
video
587+
.getOrCreateCall(
588+
"default",
589+
callId,
590+
GetOrCreateCallRequest.builder()
591+
.data(
592+
CallRequest.builder()
593+
.createdByID(userId)
594+
.settingsOverride(
595+
CallSettingsRequest.builder()
596+
.backstage(
597+
BackstageSettingsRequest.builder()
598+
.enabled(true)
599+
.joinAheadTimeSeconds(300)
600+
.build())
601+
.build())
602+
.build())
603+
.build())
604+
.execute();
605+
606+
assertNotNull(createResp.getData());
607+
assertNotNull(createResp.getData().getCall());
608+
assertEquals(300, createResp.getData().getCall().getJoinAheadTimeSeconds());
609+
610+
// Update join_ahead_time_seconds to 600
611+
var updateResp =
612+
video
613+
.updateCall(
614+
"default",
615+
callId,
616+
UpdateCallRequest.builder()
617+
.settingsOverride(
618+
CallSettingsRequest.builder()
619+
.backstage(
620+
BackstageSettingsRequest.builder()
621+
.joinAheadTimeSeconds(600)
622+
.build())
623+
.build())
624+
.build())
625+
.execute();
626+
627+
assertNotNull(updateResp.getData());
628+
assertEquals(600, updateResp.getData().getCall().getJoinAheadTimeSeconds());
629+
630+
// Update join_ahead_time_seconds to 0 (disable)
631+
var updateResp2 =
632+
video
633+
.updateCall(
634+
"default",
635+
callId,
636+
UpdateCallRequest.builder()
637+
.settingsOverride(
638+
CallSettingsRequest.builder()
639+
.backstage(
640+
BackstageSettingsRequest.builder()
641+
.joinAheadTimeSeconds(0)
642+
.build())
643+
.build())
644+
.build())
645+
.execute();
646+
647+
assertNotNull(updateResp2.getData());
648+
assertEquals(0, updateResp2.getData().getCall().getJoinAheadTimeSeconds());
649+
}
650+
575651
@Test
576652
@Order(8)
577653
void testDeactivateUser() throws Exception {

0 commit comments

Comments
 (0)