@Override public void publish(AbstractEvent abstractEvent) { LOG.debug("Publish event: {}", abstractEvent); try { applicationApplicationEventPublisher.publishEvent(abstractEvent); } catch (IllegalStateException e) { String message = e.getMessage(); if (message != null && message.contains("has been closed already")) { return; } throw e; } catch (BeanCreationNotAllowedException e) { String message = e.getMessage(); boolean ignoreException = message.contains("Singleton bean creation not allowed while singletons of this factory are in destruction"); if (ignoreException) { return; } throw e; } } }
@Override @After public void tearDown() throws Exception { // wait for outstanding threads to complete for 1 minute ThreadMonitor.tearDown(60000); try { stopLifecycles(this.perTestLifeCycles); // Avoid failing test for creation of bean in destroy. } catch (BeanCreationNotAllowedException bcnae) { LOG.warn("BeanCreationNotAllowedException during stopLifecycles during tearDown " + bcnae.getMessage()); } testEnd = System.currentTimeMillis(); report("Total time to run test: " + (testEnd - testStart)); logAfterRun(); }