@Test
public void testGetRooms_withPrivateAndArhivedRooms() throws Exception {

    chatConfig.includePrivateRooms = true;
    chatConfig.includeArchivedRooms = true;
    underTest = spy(new JsonSlackDAO(config, mockClient));
    // channels.list
    WebResource mockChanResource = mock(WebResource.class);
    when(mockResource.path("channels.list")).thenReturn(mockChanResource);
    URI channelListURI =
        Resources.getResource("slack_api_responses/channels.list.archived.txt").toURI();
    Path channelsPath = Paths.get(channelListURI);
    String channelsResponseStr = new String(Files.readAllBytes(channelsPath));
    doReturn(channelsResponseStr).when(underTest).getJsonResultWithRetries(mockChanResource,
                                                                           apiRetries);
    // groups.list
    WebResource mockGroupsResource = mock(WebResource.class);
    when(mockResource.path("groups.list")).thenReturn(mockGroupsResource);
    URI groupsListURI =
        Resources.getResource("slack_api_responses/groups.list.archived.txt").toURI();
    Path groupsPath = Paths.get(groupsListURI);
    String groupsResponseStr = new String(Files.readAllBytes(groupsPath));
    doReturn(groupsResponseStr).when(underTest).getJsonResultWithRetries(mockGroupsResource,
                                                                         apiRetries);
    Map<String, Room> rooms = underTest.getRooms();
    assertEquals(4, rooms.size());
    for (Room room : rooms.values()) {
        assertNotNull(room);
    }
}