openvidu-test-e2e: restApiTest fix

pull/375/head
pabloFuente 2019-06-27 15:15:03 +02:00
parent 921b7c1ea8
commit 0508971563
2 changed files with 7 additions and 5 deletions

View File

@ -2581,7 +2581,8 @@ public class OpenViduTestAppE2eTest {
/** GET /config **/
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,"
+ "'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

View File

@ -100,17 +100,18 @@ public class CustomHttpClient {
JSONObject jsonObjExpected = null;
jsonReturnedValue.replaceAll("'", "\"");
try {
jsonObjExpected = new JSONObject((String) jsonReturnedValue);
jsonObjExpected = new JSONObject(jsonReturnedValue);
} catch (JSONException e1) {
Assert.fail("Expected json element is a string without a JSON format: " + jsonReturnedValue);
}
if (exactReturnedFields) {
Assert.assertEquals("Error in number of keys in JSON response to POST (" + json.toString() + ")" + path, jsonObjExpected.length(),
json.length());
Assert.assertEquals("Error in number of keys in JSON response to POST (" + json.toString() + ")" + path,
jsonObjExpected.length(), json.length());
}
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;
}