@Test
public void testEncode() throws Exception {

    DateTime eventTime = DateTime.now(DateTimeZone.UTC);
    MessageSummary msgSummary = new MessageSummary("user", "room",
                                                   DateTime.now(DateTimeZone.UTC),
                                                   MessageType.BOT_MESSAGE, 1, false);
    ChatAlyticsEvent event = new ChatAlyticsEvent(eventTime, msgSummary.getClass().getName(),
                                                  msgSummary);
    String jsonStr = underTest.encode(event);
    ChatAlyticsEvent decodedEvent = new ChatAlyticsEventDecoder().decode(jsonStr);
    assertEquals(event, decodedEvent);
}