### Question:
AwaitingNonWebApplicationListener implements SmartApplicationListener { static AtomicBoolean getAwaited() { return awaited; }  @Override boolean supportsEventType(Class<? extends ApplicationEvent> eventType); @Override boolean supportsSourceType(Class<?> sourceType); @Override void onApplicationEvent(ApplicationEvent event); @Override int getOrder();  }### Answer:
@Test public void init() { AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited(); awaited.set(false); }
@Test public void testSingleContextNonWebApplication() { new SpringApplicationBuilder(Object.class) .web(false) .run().close(); AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited(); Assert.assertTrue(awaited.get()); }
@Test public void testMultipleContextNonWebApplication() { new SpringApplicationBuilder(Object.class) .parent(Object.class) .web(false) .run().close(); AtomicBoolean awaited = AwaitingNonWebApplicationListener.getAwaited(); Assert.assertTrue(awaited.get()); }