mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: fix new response of POST /api/sessions
parent
c6019394ec
commit
1a8733b2ea
|
@ -46,14 +46,6 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.google.gson.JsonArray;
|
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
import com.google.gson.JsonParser;
|
|
||||||
import com.google.gson.stream.JsonReader;
|
|
||||||
import com.mashape.unirest.http.HttpMethod;
|
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
import org.jcodec.api.FrameGrab;
|
import org.jcodec.api.FrameGrab;
|
||||||
|
@ -80,6 +72,14 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
import com.google.gson.stream.JsonReader;
|
||||||
|
import com.mashape.unirest.http.HttpMethod;
|
||||||
|
|
||||||
import io.github.bonigarcia.wdm.WebDriverManager;
|
import io.github.bonigarcia.wdm.WebDriverManager;
|
||||||
import io.openvidu.java.client.Connection;
|
import io.openvidu.java.client.Connection;
|
||||||
import io.openvidu.java.client.KurentoOptions;
|
import io.openvidu.java.client.KurentoOptions;
|
||||||
|
@ -341,7 +341,7 @@ public class OpenViduTestAppE2eTest {
|
||||||
|
|
||||||
// Check codecs
|
// Check codecs
|
||||||
List<WebElement> statsButtons = user.getDriver().findElements(By.className("stats-button"));
|
List<WebElement> statsButtons = user.getDriver().findElements(By.className("stats-button"));
|
||||||
for(WebElement statButton: statsButtons) {
|
for (WebElement statButton : statsButtons) {
|
||||||
statButton.click();
|
statButton.click();
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
String videoCodecUsed = user.getDriver().findElement(By.id("video-codec-used")).getText();
|
String videoCodecUsed = user.getDriver().findElement(By.id("video-codec-used")).getText();
|
||||||
|
@ -2585,10 +2585,11 @@ public class OpenViduTestAppE2eTest {
|
||||||
// 200
|
// 200
|
||||||
body = "{'mediaMode': 'ROUTED', 'recordingMode': 'MANUAL', 'customSessionId': 'CUSTOM_SESSION_ID', 'defaultOutputMode': 'COMPOSED', 'defaultRecordingLayout': 'BEST_FIT'}";
|
body = "{'mediaMode': 'ROUTED', 'recordingMode': 'MANUAL', 'customSessionId': 'CUSTOM_SESSION_ID', 'defaultOutputMode': 'COMPOSED', 'defaultRecordingLayout': 'BEST_FIT'}";
|
||||||
restClient.rest(HttpMethod.POST, "/api/sessions", body, HttpStatus.SC_OK, true,
|
restClient.rest(HttpMethod.POST, "/api/sessions", body, HttpStatus.SC_OK, true,
|
||||||
"{'id': 'STR', 'createdAt': 0}");
|
"{'id':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','allowTranscoding':false,'connections':{'numberOfElements':0,'content':[]},'recording':true}");
|
||||||
|
|
||||||
// Default values
|
// Default values
|
||||||
JsonObject res = restClient.rest(HttpMethod.POST, "/api/sessions", "{}", HttpStatus.SC_OK, true,
|
JsonObject res = restClient.rest(HttpMethod.POST, "/api/sessions", "{}", HttpStatus.SC_OK, true,
|
||||||
"{'id': 'STR', 'createdAt': 0}");
|
"{'id':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','allowTranscoding':false,'connections':{'numberOfElements':0,'content':[]},'recording':true}");
|
||||||
restClient.rest(HttpMethod.DELETE, "/api/sessions/" + res.get("id").getAsString(), HttpStatus.SC_NO_CONTENT);
|
restClient.rest(HttpMethod.DELETE, "/api/sessions/" + res.get("id").getAsString(), HttpStatus.SC_NO_CONTENT);
|
||||||
|
|
||||||
// 409
|
// 409
|
||||||
|
@ -2676,7 +2677,7 @@ public class OpenViduTestAppE2eTest {
|
||||||
|
|
||||||
// 409 (RELAYED media mode)
|
// 409 (RELAYED media mode)
|
||||||
res = restClient.rest(HttpMethod.POST, "/api/sessions", "{'mediaMode':'RELAYED'}", HttpStatus.SC_OK, true,
|
res = restClient.rest(HttpMethod.POST, "/api/sessions", "{'mediaMode':'RELAYED'}", HttpStatus.SC_OK, true,
|
||||||
"{'id': 'STR', 'createdAt': 0}");
|
"{'id':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','allowTranscoding':false,'connections':{'numberOfElements':0,'content':[]},'recording':true}");
|
||||||
body = "{'session':'" + res.get("id").getAsString() + "'}";
|
body = "{'session':'" + res.get("id").getAsString() + "'}";
|
||||||
restClient.rest(HttpMethod.POST, "/api/recordings/start", body, HttpStatus.SC_CONFLICT);
|
restClient.rest(HttpMethod.POST, "/api/recordings/start", body, HttpStatus.SC_CONFLICT);
|
||||||
restClient.rest(HttpMethod.DELETE, "/api/sessions/" + res.get("id").getAsString(), HttpStatus.SC_NO_CONTENT);
|
restClient.rest(HttpMethod.DELETE, "/api/sessions/" + res.get("id").getAsString(), HttpStatus.SC_NO_CONTENT);
|
||||||
|
@ -3154,7 +3155,8 @@ public class OpenViduTestAppE2eTest {
|
||||||
|
|
||||||
// Init a session and publish IP camera AS FIRST PARTICIPANT
|
// Init a session and publish IP camera AS FIRST PARTICIPANT
|
||||||
restClient.rest(HttpMethod.POST, "/api/sessions", "{'customSessionId':'IP_CAM_SESSION'}", HttpStatus.SC_OK,
|
restClient.rest(HttpMethod.POST, "/api/sessions", "{'customSessionId':'IP_CAM_SESSION'}", HttpStatus.SC_OK,
|
||||||
true, "{'id': 'STR', 'createdAt': 0}");
|
true,
|
||||||
|
"{'id':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultOutputMode':'STR','defaultRecordingLayout':'STR','customSessionId':'STR','forcedVideoCodec':'STR','allowTranscoding':false,'connections':{'numberOfElements':0,'content':[]},'recording':true}");
|
||||||
|
|
||||||
// No rtspUri [400]
|
// No rtspUri [400]
|
||||||
restClient.rest(HttpMethod.POST, "/api/sessions/IP_CAM_SESSION/connection", "{}",
|
restClient.rest(HttpMethod.POST, "/api/sessions/IP_CAM_SESSION/connection", "{}",
|
||||||
|
|
Loading…
Reference in New Issue