@Test
public void testUserGroupListShouldBeSuccessful() {

    mockServer.expect()
            .get()
            .withPath("/api/v1/groups.list")
            .andReturn(200, "{" +
                    "    \"groups\": [" +
                    "        {" +
                    "            \"_id\": \"ByehQjC44FwMeiLbX\"," +
                    "            \"name\": \"test-test\"," +
                    "            \"t\": \"p\"," +
                    "            \"usernames\": [" +
                    "                \"testing1\"" +
                    "            ]," +
                    "            \"msgs\": 0," +
                    "            \"u\": {" +
                    "                \"_id\": \"aobEdbYhXfu5hkeqG\"," +
                    "                \"username\": \"testing1\"" +
                    "            }," +
                    "            \"ts\": \"2016-12-09T15:08:58.042Z\"," +
                    "            \"ro\": false," +
                    "            \"sysMes\": true," +
                    "            \"_updatedAt\": \"2016-12-09T15:22:40.656Z\"" +
                    "        }," +
                    "        {" +
                    "            \"_id\": \"t7qapfhZjANMRAi5w\"," +
                    "            \"name\": \"testing\"," +
                    "            \"t\": \"p\"," +
                    "            \"usernames\": [" +
                    "                \"testing2\"" +
                    "            ]," +
                    "            \"msgs\": 0," +
                    "            \"u\": {" +
                    "                \"_id\": \"y65tAmHs93aDChMWu\"," +
                    "                \"username\": \"testing2\"" +
                    "            }," +
                    "            \"ts\": \"2016-12-01T15:08:58.042Z\"," +
                    "            \"ro\": false," +
                    "            \"sysMes\": true," +
                    "            \"_updatedAt\": \"2016-12-09T15:22:40.656Z\"" +
                    "        }" +
                    "    ]," +
                    "    \"success\": true" +
                    "}")
            .once();
    rest.getUserGroupList(subscriptionsCallback);
    verify(subscriptionsCallback, timeout(DEFAULT_TIMEOUT).only())
            .onSuccess(subscriptionsCaptor.capture());
    List<Subscription> subscriptionList = subscriptionsCaptor.getValue();
    assertThat(subscriptionList, is(notNullValue()));
    assertThat(subscriptionList.size(), is(equalTo(2)));
    Subscription subscription = subscriptionList.get(0);
    assertThat(subscription.roomId(), is(equalTo("ByehQjC44FwMeiLbX")));
    assertThat(subscription.name(), is(equalTo("test-test")));
    assertThat(subscription.type(), is(equalTo(BaseRoom.RoomType.PRIVATE)));
}