@Test
public void testJSONDeserialization() throws Exception {

	String jsonString = read("analytics_events_message.json");
	AnalyticsEventsMessage analyticsEventsMessage = _jsonObjectMapper.map(
		jsonString);
	Assert.assertEquals(
		"DataSourceId", analyticsEventsMessage.getDataSourceId());
	Map<String, String> context = analyticsEventsMessage.getContext();
	Assert.assertEquals("v1", context.get("k1"));
	Assert.assertEquals("v2", context.get("k2"));
	List<AnalyticsEventsMessage.Event> events =
		analyticsEventsMessage.getEvents();
	Assert.assertEquals(events.toString(), 1, events.size());
	AnalyticsEventsMessage.Event event = events.get(0);
	Assert.assertEquals("ApplicationId", event.getApplicationId());
	Assert.assertEquals(
		ISO8601Utils.parse(
			"2017-11-20T19:52:56.723Z", new ParsePosition(0)),
		event.getEventDate());
	Assert.assertEquals("View", event.getEventId());
	Map<String, String> properties = event.getProperties();
	Assert.assertEquals("v1", properties.get("k1"));
	Assert.assertEquals("v2", properties.get("k2"));
	Assert.assertEquals("1.0", analyticsEventsMessage.getProtocolVersion());
	Assert.assertEquals("UserId", analyticsEventsMessage.getUserId());
}