EventLogger.logEvent(msg);
assertNotNull("No events generated", listAppender1.getEvents());
assertTrue("Incorrect number of events. Expected 1, got " + listAppender1.getEvents().size(), listAppender1.getEvents().size() == 1);
// now set jndi resource to Application2
context.rebind(JNDI_CONTEXT_NAME, "Application2");
msg = new StructuredDataMessage("Test", "This is a message from Application2", "Context");
EventLogger.logEvent(msg);
assertNotNull("No events generated", listAppender2.getEvents());
assertTrue("Incorrect number of events. Expected 1, got " + listAppender2.getEvents().size(), listAppender2.getEvents().size() == 1);