em.persist(eventDefinition);
EventSource eventSource = createEventSource(eventDefinition, resource);
em.persist(eventSource);
int fatalEventCount = 7;
for (int i = 0; i < fatalEventCount; i++) {
Event event = createEvent(eventSource, EventSeverity.FATAL);
em.persist(event);
}
int warnEventCount = 5;
for (int i = 0; i < warnEventCount; i++) {
Event event = createEvent(eventSource, EventSeverity.WARN);
em.persist(event);
}
int infoEventCount = 9;
for (int i = 0; i < infoEventCount; i++) {
Event event = createEvent(eventSource, EventSeverity.INFO);
em.persist(event);
}
em.flush();
Map<EventSeverity, Integer> eventCountsBySeverity = eventManager.getEventCountsBySeverityForGroup(
subjectManager.getOverlord(), resourceGroup.getId(), 0, System.currentTimeMillis());