title: Unit Testing Spring ApplicationEvents - Events are getting published but the listeners aren't firing?
body: <p>I'm trying to unit test the custom events that I've created in Spring and am running into an interesting problem.  If I create a <code>StaticApplicationContext</code> and manually register and wire the beans I can trigger events and see the program flow through the publisher (implements <code>ApplicationEventPublisherAware</code>) through to the listener (implements <code>ApplicationListener&lt;?&gt;</code>).  </p>
  
  <p>Yet when I try to create a JUnit test to create the context using the <code>SpringJunit4ClassRunner</code> and <code>@ContextConfiguration</code> everything works well except that the ApplicationEvents are not showing up in the listener (I have confirmed that they are getting published).</p>
  
  <p>Is there some other way to create the context so that ApplicationEvents will work correctly?  I haven't found much on the web about unit testing the Spring events framework.</p>