.user(getTestUser())
.authType(AuthType.OAUTH)
.build());
int iterationCount = 0;
Event taEvent = null;
while (taEvent == null) {
Thread.sleep(10000);
if (iterationCount++ == 5) {
Assert.fail("Unable to poll Twitter in the allotted amount of time.");
}
List<Event> allEvents = eventService.getEventsForAccount(getTestAccount());
for (Event event : allEvents) {
if (event.getEventId().equals(EventId.ACTIVITY)) {
taEvent = event;
}
}
}
Map<String, Object> taEventMetadata = taEvent.getMetadata();
Assert.assertEquals(EventId.ACTIVITY, taEvent.getEventId());
Assert.assertTrue(taEventMetadata.containsKey("activityTitle"));
Assert.assertTrue(taEventMetadata.containsKey("activityContent"));
Assert.assertTrue(taEventMetadata.containsKey("activityPayload"));
}