openvidu-server: set ready state to COMPOSED video recordings

pull/375/head
pabloFuente 2019-06-27 16:36:21 +02:00
parent 0508971563
commit 86540ab3a8
3 changed files with 20 additions and 3 deletions

View File

@ -325,6 +325,10 @@ public class ComposedRecordingService extends RecordingService {
"There was an error generating the metadata report file for the recording"); "There was an error generating the metadata report file for the recording");
} }
String filesPath = this.openviduConfig.getOpenViduRecordingPath() + recording.getId() + "/";
recording = this.sealRecordingMetadataFileAsReady(recording, recording.getSize(), recording.getDuration(),
filesPath + RecordingManager.RECORDING_ENTITY_FILE + recording.getId());
final long timestamp = System.currentTimeMillis(); final long timestamp = System.currentTimeMillis();
this.cdr.recordRecordingStopped(recording, reason, timestamp); this.cdr.recordRecordingStopped(recording, reason, timestamp);
this.cdr.recordRecordingStatusChanged(recording, reason, timestamp, recording.getStatus()); this.cdr.recordRecordingStatusChanged(recording, reason, timestamp, recording.getStatus());

View File

@ -2582,7 +2582,7 @@ public class OpenViduTestAppE2eTest {
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'," + "'openviduRecordingVersion':'STR','openviduRecordingPath':'STR','openviduRecordingPublicAccess':false,'openviduRecordingNotification':'STR',"
+ "'openviduRecordingCustomLayout':'STR','openviduRecordingAutostopTimeout':0,'openviduWebhook':false,'openviduWebhookEndpoint':'STR','openviduWebhookHeaders':'STR','openviduWebhookEvents':'STR',}"); + "'openviduRecordingCustomLayout':'STR','openviduRecordingAutostopTimeout':0,'openviduWebhook':false,'openviduWebhookEndpoint':'STR','openviduWebhookHeaders':[],'openviduWebhookEvents':[],}");
} }
@Test @Test

View File

@ -110,8 +110,13 @@ public class CustomHttpClient {
jsonObjExpected.length(), json.length()); jsonObjExpected.length(), json.length());
} }
for (String key : jsonObjExpected.keySet()) { for (String key : jsonObjExpected.keySet()) {
Assert.assertTrue("Wrong class of property " + key, Class<?> c1 = jsonObjExpected.get(key).getClass();
jsonObjExpected.get(key).getClass().equals(json.get(key).getClass())); Class<?> c2 = json.get(key).getClass();
c1 = unifyNumberType(c1);
c2 = unifyNumberType(c2);
Assert.assertTrue("Wrong class of property " + key, c1.equals(c2));
} }
return json; return json;
} }
@ -217,4 +222,12 @@ public class CustomHttpClient {
Assert.assertEquals(path + " expected to return status " + status, status, jsonResponse.getStatus()); Assert.assertEquals(path + " expected to return status " + status, status, jsonResponse.getStatus());
return json; return json;
} }
private Class<?> unifyNumberType(Class<?> myClass) {
if (Number.class.isAssignableFrom(myClass)) {
return Number.class;
}
return myClass;
}
} }