@Test
public void testGetMessages() throws Exception {

    // channels.history
    WebResource mockHistoryResrc = mock(WebResource.class);
    when(mockResource.path("channels.history")).thenReturn(mockHistoryResrc);
    when(mockHistoryResrc.queryParam(anyString(), anyString())).thenReturn(mockHistoryResrc);
    URI historyURI = Resources.getResource("slack_api_responses/channels.history.txt").toURI();
    Path historyPath = Paths.get(historyURI);
    String historyResponseStr = new String(Files.readAllBytes(historyPath));
    doReturn(historyResponseStr).when(underTest).getJsonResultWithRetries(mockHistoryResrc,
                                                                          apiRetries);
    Room mockRoom = mock(Room.class);
    when(mockRoom.getRoomId()).thenReturn("C0SDFG423");
    DateTime now = DateTime.now();
    List<Message> messages = underTest.getMessages(now.minusDays(1), now, mockRoom);
    assertEquals(7, messages.size());
    for (Message message : messages) {
        assertNotNull(message);
    }
}