@Test
public void testGetRoomFilesShouldBeSuccessful() {

    mockServer.expect()
            .get()
            .withPath("/api/v1/channels.files?roomId=general&offset=0&sort={%22uploadedAt%22:-1}")
            .andReturn(200,
                    "{\"total\":5000," +
                            "   \"offset\":0," +
                            "   \"success\":true," +
                            "   \"count\":1," +
                            "   \"files\":[" +
                            "      {" +
                            "         \"extension\":\"txt\"," +
                            "         \"description\":\"\"," +
                            "         \"store\":\"GoogleCloudStorage:Uploads\"," +
                            "         \"type\":\"text/plain\"," +
                            "         \"rid\":\"GENERAL\"," +
                            "         \"userId\":\"mTYz5v78fEETuyvxH\"," +
                            "         \"url\":\"/ufs/GoogleCloudStorage:Uploads/B5HXEJQvoqXjfMyKD/%E6%96%B0%E5%BB%BA%E6%96%87%E6%9C%AC%E6%96%87%E6%A1%A3%20(2).txt\"," +
                            "         \"token\":\"C8BB59192B\"," +
                            "         \"path\":\"/ufs/GoogleCloudStorage:Uploads/B5HXEJQvoqXjfMyKD/%E6%96%B0%E5%BB%BA%E6%96%87%E6%9C%AC%E6%96%87%E6%A1%A3%20(2).txt\"," +
                            "         \"GoogleStorage\":{" +
                            "            \"path\":\"eoRXMCHBbQCdDnrke/uploads/GENERAL/mTYz5v78fEETuyvxH/B5HXEJQvoqXjfMyKD\"" +
                            "         }," +
                            "         \"instanceId\":\"kPnqzFNvmxkMWdcKC\"," +
                            "         \"size\":469," +
                            "         \"name\":\"sample.txt\"," +
                            "         \"progress\":1," +
                            "         \"uploadedAt\":\"2017-10-23T05:13:44.875Z\"," +
                            "         \"uploading\":false," +
                            "         \"etag\":\"mXWYhuiWiCxXpDYdg\"," +
                            "         \"_id\":\"B5HXEJQvoqXjfMyKD\"," +
                            "         \"complete\":true," +
                            "         \"_updatedAt\":\"2017-10-23T05:13:43.220Z\"" +
                            "      }" +
                            "   ]" +
                            "}")
            .once();
    rest.getRoomFiles("general", BaseRoom.RoomType.PUBLIC, 0, Attachment.SortBy.UPLOADED_DATE, Sort.DESC, attachmentCallback);
    verify(attachmentCallback, timeout(DEFAULT_TIMEOUT).only())
            .onSuccess(attachmentsCaptor.capture(), anyInt());
    List<Attachment> attachmentList = attachmentsCaptor.getValue();
    assertThat(attachmentList, is(notNullValue()));
    assertThat(attachmentList.size(), is(equalTo(1)));
    Attachment attachment = attachmentList.get(0);
    assertThat(attachment.getId(), is(equalTo("B5HXEJQvoqXjfMyKD")));
    assertThat(attachment.getName(), is(equalTo("sample.txt")));
}