openvidu-test-e2e: fix end reasons

v2compatibility
pabloFuente 2025-02-14 14:29:10 +01:00
parent 73fef3f933
commit 1a53483921
1 changed files with 8 additions and 5 deletions

View File

@ -381,10 +381,10 @@ public class OpenViduProTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
// for (int i = 0; i < 3; i++) { // for (int i = 0; i < 3; i++) {
// webrtcConnectionDestroyed event is only triggered when participant left in // webrtcConnectionDestroyed event is only triggered when participant left in
// v2Compatibility // v2Compatibility
Assertions.assertEquals("unpublish", // reason is always "unpublish" in v2Compatibility Assertions.assertEquals("unpublish",
CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 5).get("reason").getAsString()); CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 5).get("reason").getAsString());
// } // }
Assertions.assertEquals("disconnect", // reason is always "disconnect" in v2Compatibility Assertions.assertEquals("forceDisconnectByServer",
CustomWebhook.waitForEvent("participantLeft", 2).get("reason").getAsString()); CustomWebhook.waitForEvent("participantLeft", 2).get("reason").getAsString());
if (CustomWebhook.events.values().stream().anyMatch(collection -> !collection.isEmpty())) { if (CustomWebhook.events.values().stream().anyMatch(collection -> !collection.isEmpty())) {
CustomWebhook.events.values().forEach(collection -> { CustomWebhook.events.values().forEach(collection -> {
@ -415,14 +415,14 @@ public class OpenViduProTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
Assertions.assertEquals("unpublish", // reason is always "unpublish" in v2Compatibility Assertions.assertEquals("unpublish", // reason is always "unpublish" in v2Compatibility
CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 60).get("reason").getAsString()); CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 60).get("reason").getAsString());
// } // }
Assertions.assertEquals("disconnect", // reason is always "disconnect" in v2Compatibility Assertions.assertEquals("forceDisconnectByServer", // reason is always "disconnect" in v2Compatibility
CustomWebhook.waitForEvent("participantLeft", 30).get("reason").getAsString()); CustomWebhook.waitForEvent("participantLeft", 30).get("reason").getAsString());
// Second user out // Second user out
restClient.rest(HttpMethod.DELETE, "/openvidu/api/sessions/TestSession/connection/" + connectionIds[1], restClient.rest(HttpMethod.DELETE, "/openvidu/api/sessions/TestSession/connection/" + connectionIds[1],
HttpURLConnection.HTTP_NO_CONTENT); HttpURLConnection.HTTP_NO_CONTENT);
Assertions.assertEquals("unpublish", // reason is always "unpublish" in v2Compatibility Assertions.assertEquals("unpublish", // reason is always "unpublish" in v2Compatibility
CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 30).get("reason").getAsString()); CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 30).get("reason").getAsString());
Assertions.assertEquals("disconnect", // reason is always "disconnect" in v2Compatibility Assertions.assertEquals("forceDisconnectByServer", // reason is always "disconnect" in v2Compatibility
CustomWebhook.waitForEvent("participantLeft", 2).get("reason").getAsString()); CustomWebhook.waitForEvent("participantLeft", 2).get("reason").getAsString());
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
Assertions.assertEquals("recordingStoppedByServer", // reason is always "recordingStoppedByServer" Assertions.assertEquals("recordingStoppedByServer", // reason is always "recordingStoppedByServer"
@ -460,7 +460,7 @@ public class OpenViduProTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 30).get("reason").getAsString()); CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 30).get("reason").getAsString());
} }
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
Assertions.assertEquals("disconnect", // reason is always "disconnect" in v2Compatibility Assertions.assertEquals("sessionClosedByServer",
CustomWebhook.waitForEvent("participantLeft", 30).get("reason").getAsString()); CustomWebhook.waitForEvent("participantLeft", 30).get("reason").getAsString());
} }
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
@ -486,8 +486,11 @@ public class OpenViduProTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
// webrtcConnectionDestroyed event is only triggered when participant left in // webrtcConnectionDestroyed event is only triggered when participant left in
// v2Compatibility // v2Compatibility
// for (int i = 0; i < 3; i++) { // for (int i = 0; i < 3; i++) {
// TODO: THIS WILL BE FIXED FOR MEDIASOUP AFTER UPGRADING IT
Assertions.assertEquals("unpublish", Assertions.assertEquals("unpublish",
CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 60).get("reason").getAsString()); CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 60).get("reason").getAsString());
// } // }
Assertions.assertEquals("disconnect", // reason is always "disconnect" in v2Compatibility Assertions.assertEquals("disconnect", // reason is always "disconnect" in v2Compatibility
CustomWebhook.waitForEvent("participantLeft", 30).get("reason").getAsString()); CustomWebhook.waitForEvent("participantLeft", 30).get("reason").getAsString());