@Test
public void testGetUsersForRoom() throws Exception {

    // channels.info
    WebResource mockChanInfoResrc = mock(WebResource.class);
    when(mockResource.path("channels.info")).thenReturn(mockChanInfoResrc);
    when(mockChanInfoResrc.queryParam(anyString(), anyString())).thenReturn(mockChanInfoResrc);
    URI chanInfoURI = Resources.getResource("slack_api_responses/channels.info.txt").toURI();
    Path channelsInfoPath = Paths.get(chanInfoURI);
    String chanInfoResponseStr = new String(Files.readAllBytes(channelsInfoPath));
    doReturn(chanInfoResponseStr).when(underTest).getJsonResultWithRetries(mockChanInfoResrc,
                                                                           apiRetries);
    // users.info
    WebResource mockUserInfoResource = mock(WebResource.class);
    when(mockResource.path("users.info")).thenReturn(mockUserInfoResource);
    // user 1
    WebResource user1InfoResource = mock(WebResource.class);
    when(mockUserInfoResource.queryParam("user", "U023BECGF")).thenReturn(user1InfoResource);
    URI userInfoURI = Resources.getResource("slack_api_responses/users.info.1.txt").toURI();
    Path usersInfoPath = Paths.get(userInfoURI);
    String userInfoResponseStr = new String(Files.readAllBytes(usersInfoPath));
    doReturn(userInfoResponseStr).when(underTest).getJsonResultWithRetries(user1InfoResource,
                                                                           apiRetries);
    // user 2
    WebResource user2InfoResource = mock(WebResource.class);
    when(mockUserInfoResource.queryParam("user", "U023TY454")).thenReturn(user2InfoResource);
    userInfoURI = Resources.getResource("slack_api_responses/users.info.2.txt").toURI();
    usersInfoPath = Paths.get(userInfoURI);
    userInfoResponseStr = new String(Files.readAllBytes(usersInfoPath));
    doReturn(userInfoResponseStr).when(underTest).getJsonResultWithRetries(user2InfoResource,
                                                                           apiRetries);
    Room mockRoom = mock(Room.class);
    when(mockRoom.getRoomId()).thenReturn("C0SDFG423");
    Map<String, User> usersForRoom = underTest.getUsersForRoom(mockRoom);
    assertEquals(2, usersForRoom.size());
    for (User user : usersForRoom.values()) {
        assertNotNull(user);
    }
}