Search in sources :

Example 1 with RecordingDTO

use of org.apache.openmeetings.db.dto.record.RecordingDTO in project openmeetings by apache.

the class TestRecordingService method testExternal.

@Test
public void testExternal() throws Exception {
    User u = getExternalUser();
    Recording r = new Recording();
    r.setInsertedBy(u.getId());
    r.setComment("Created by Unit Tests");
    r.setRoomId(5L);
    r = getBean(RecordingDao.class).update(r);
    ServiceResult sr = login();
    Collection<? extends RecordingDTO> recs = getClient(getRecordUrl()).path("/" + UNIT_TEST_EXT_TYPE).query("sid", sr.getMessage()).getCollection(RecordingDTO.class);
    assertNotNull("Valid collection should be returned", recs);
    assertFalse("Collection of the recordings should not be empty", recs.isEmpty());
    boolean found = false;
    for (RecordingDTO rdo : recs) {
        if (r.getId().equals(rdo.getId())) {
            // TODO check room, user
            found = true;
            break;
        }
    }
    assertTrue("Just created recording was not found by the service", found);
}
Also used : User(org.apache.openmeetings.db.entity.user.User) AbstractJUnitDefaults.getUser(org.apache.openmeetings.AbstractJUnitDefaults.getUser) ServiceResult(org.apache.openmeetings.db.dto.basic.ServiceResult) RecordingDTO(org.apache.openmeetings.db.dto.record.RecordingDTO) Recording(org.apache.openmeetings.db.entity.record.Recording) Test(org.junit.Test)

Aggregations

AbstractJUnitDefaults.getUser (org.apache.openmeetings.AbstractJUnitDefaults.getUser)1 ServiceResult (org.apache.openmeetings.db.dto.basic.ServiceResult)1 RecordingDTO (org.apache.openmeetings.db.dto.record.RecordingDTO)1 Recording (org.apache.openmeetings.db.entity.record.Recording)1 User (org.apache.openmeetings.db.entity.user.User)1 Test (org.junit.Test)1