Search in sources :

Example 1 with RoomFileDTO

use of org.apache.openmeetings.db.dto.room.RoomFileDTO in project openmeetings by apache.

the class TestRoomService method testCreateWithFiles2.

@Test
public void testCreateWithFiles2() throws IOException {
    // lets create real file
    CallResult<FileItemDTO> fileCall = createVerifiedFile(getDefaultProfilePicture(), "img.jpg", BaseFileItem.Type.Image);
    Room.Type type = Room.Type.presentation;
    String name = "Unit Test Ext Room4";
    String comment = "Unit Test Ext Room Comments4";
    RoomDTO r = new RoomDTO();
    r.setType(type);
    r.setName(name);
    r.setComment(comment);
    r.setCapacity(CAPACITY);
    RoomFileDTO rf = new RoomFileDTO();
    // not existent
    rf.setFileId(fileCall.getObj().getId());
    r.getFiles().add(rf);
    CallResult<RoomDTO> res = createAndValidate(fileCall.getSid(), r);
    assertFalse("Room files should NOT be empty", res.getObj().getFiles().isEmpty());
}
Also used : RoomDTO(org.apache.openmeetings.db.dto.room.RoomDTO) FileItemDTO(org.apache.openmeetings.db.dto.file.FileItemDTO) Room(org.apache.openmeetings.db.entity.room.Room) RoomFileDTO(org.apache.openmeetings.db.dto.room.RoomFileDTO) Test(org.junit.Test)

Example 2 with RoomFileDTO

use of org.apache.openmeetings.db.dto.room.RoomFileDTO in project openmeetings by apache.

the class TestRoomService method testCreateWithFiles1.

@Test
public void testCreateWithFiles1() {
    Room.Type type = Room.Type.presentation;
    String name = "Unit Test Ext Room3";
    String comment = "Unit Test Ext Room Comments3";
    RoomDTO r = new RoomDTO();
    r.setType(type);
    r.setName(name);
    r.setComment(comment);
    r.setCapacity(CAPACITY);
    RoomFileDTO rf = new RoomFileDTO();
    // not existent
    rf.setFileId(-666L);
    r.getFiles().add(rf);
    CallResult<RoomDTO> res = createAndValidate(r);
    assertTrue("No room files should be added", res.getObj().getFiles().isEmpty());
}
Also used : RoomDTO(org.apache.openmeetings.db.dto.room.RoomDTO) Room(org.apache.openmeetings.db.entity.room.Room) RoomFileDTO(org.apache.openmeetings.db.dto.room.RoomFileDTO) Test(org.junit.Test)

Aggregations

RoomDTO (org.apache.openmeetings.db.dto.room.RoomDTO)2 RoomFileDTO (org.apache.openmeetings.db.dto.room.RoomFileDTO)2 Room (org.apache.openmeetings.db.entity.room.Room)2 Test (org.junit.Test)2 FileItemDTO (org.apache.openmeetings.db.dto.file.FileItemDTO)1