@Test
public void testUserDirectMessagelListShouldBeSuccessful() {

    mockServer.expect()
            .get()
            .withPath("/api/v1/dm.list")
            .andReturn(200, "{" +
                    "   \"success\":true," +
                    "   \"ims\":[" +
                    "      {" +
                    "         \"msgs\":90," +
                    "         \"lm\":\"2017-09-29T14:43:54.207Z\"," +
                    "         \"t\":\"d\"," +
                    "         \"usernames\":[" +
                    "            \"user1\"," +
                    "            \"user2\"" +
                    "         ]," +
                    "         \"_id\":\"0WCaFa2Jve4FEjMYacBD6dHcSoBvGjkrzM\"," +
                    "         \"_updatedAt\":\"2017-09-29T14:43:54.286Z\"," +
                    "         \"ts\":\"2017-08-15T17:56:09.013Z\"" +
                    "      }," +
                    "      {" +
                    "         \"msgs\":2," +
                    "         \"lm\":\"2017-08-18T18:01:33.580Z\"," +
                    "         \"t\":\"d\"," +
                    "         \"usernames\":[" +
                    "            \"user1\"," +
                    "            \"user3\"" +
                    "         ]," +
                    "         \"_id\":\"0WCaFa2Jve4FEjMYacBD6dHcIoBEGjJszO\"," +
                    "         \"_updatedAt\":\"2017-08-18T18:01:33.667Z\"," +
                    "         \"ts\":\"2017-08-18T18:00:57.369Z\"" +
                    "      }" +
                    "   ]" +
                    "}")
            .once();
    rest.getUserDirectMessageList(simpleListCallback);
    verify(simpleListCallback, timeout(DEFAULT_TIMEOUT).only())
            .onSuccess(listCaptor.capture());
    List<Subscription> subscriptionList = listCaptor.getValue();
    assertThat(subscriptionList, is(notNullValue()));
    assertThat(subscriptionList.size(), is(equalTo(2)));
    Subscription subscription = subscriptionList.get(0);
    assertThat(subscription.roomId(), is(equalTo("0WCaFa2Jve4FEjMYacBD6dHcSoBvGjkrzM")));
    assertThat(subscription.type(), is(equalTo(BaseRoom.RoomType.ONE_TO_ONE)));
}