mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: restApiTest fix
parent
921b7c1ea8
commit
0508971563
|
@ -2581,7 +2581,8 @@ public class OpenViduTestAppE2eTest {
|
||||||
/** GET /config **/
|
/** GET /config **/
|
||||||
restClient.rest(HttpMethod.GET, "/config", null, HttpStatus.SC_OK, true,
|
restClient.rest(HttpMethod.GET, "/config", null, HttpStatus.SC_OK, true,
|
||||||
"{'version':'STR','openviduPublicurl':'STR','openviduCdr':false,'maxRecvBandwidth':0,'minRecvBandwidth':0,'maxSendBandwidth':0,'minSendBandwidth':0,'openviduRecording':false,"
|
"{'version':'STR','openviduPublicurl':'STR','openviduCdr':false,'maxRecvBandwidth':0,'minRecvBandwidth':0,'maxSendBandwidth':0,'minSendBandwidth':0,'openviduRecording':false,"
|
||||||
+ "'openviduRecordingVersion':'STR','openviduRecordingPath':'STR','openviduRecordingPublicAccess':false,'openviduRecordingNotification':'STR','openviduRecordingCustomLayout':'STR','openviduRecordingAutostopTimeout':0}");
|
+ "'openviduRecordingVersion':'STR','openviduRecordingPath':'STR','openviduRecordingPublicAccess':false,'openviduRecordingNotification':'STR',"
|
||||||
|
+ "'openviduRecordingCustomLayout':'STR','openviduRecordingAutostopTimeout':0,'openviduWebhook':false,'openviduWebhookEndpoint':'STR','openviduWebhookHeaders':'STR','openviduWebhookEvents':'STR',}");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -100,17 +100,18 @@ public class CustomHttpClient {
|
||||||
JSONObject jsonObjExpected = null;
|
JSONObject jsonObjExpected = null;
|
||||||
jsonReturnedValue.replaceAll("'", "\"");
|
jsonReturnedValue.replaceAll("'", "\"");
|
||||||
try {
|
try {
|
||||||
jsonObjExpected = new JSONObject((String) jsonReturnedValue);
|
jsonObjExpected = new JSONObject(jsonReturnedValue);
|
||||||
} catch (JSONException e1) {
|
} catch (JSONException e1) {
|
||||||
Assert.fail("Expected json element is a string without a JSON format: " + jsonReturnedValue);
|
Assert.fail("Expected json element is a string without a JSON format: " + jsonReturnedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exactReturnedFields) {
|
if (exactReturnedFields) {
|
||||||
Assert.assertEquals("Error in number of keys in JSON response to POST (" + json.toString() + ")" + path, jsonObjExpected.length(),
|
Assert.assertEquals("Error in number of keys in JSON response to POST (" + json.toString() + ")" + path,
|
||||||
json.length());
|
jsonObjExpected.length(), json.length());
|
||||||
}
|
}
|
||||||
for (String key : jsonObjExpected.keySet()) {
|
for (String key : jsonObjExpected.keySet()) {
|
||||||
json.get(key);
|
Assert.assertTrue("Wrong class of property " + key,
|
||||||
|
jsonObjExpected.get(key).getClass().equals(json.get(key).getClass()));
|
||||||
}
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue