@Test public void testBootstrapShouldStartWilmaEngine() { given(applicationContext.getBean(WilmaEngine.class)).willReturn(wilmaEngine); underTest.bootstrap(); verify(wilmaEngine).start(); }
public void bootstrap() { ClassPathXmlApplicationContext applicationContext = null; try { applicationContext = getApplicationContext(); WilmaEngine wilmaEngine = applicationContext.getBean(WilmaEngine.class); WilmaServiceListener wilmaServiceListener = applicationContext.getBean(WilmaServiceListener.class); wilmaEngine.addListener(wilmaServiceListener, MoreExecutors.directExecutor()); wilmaEngine.start(); } catch (Exception e) { logErrorByTypeOfException(e); closeApplicationContext(applicationContext); } }
WilmaBootstrap { public void bootstrap() { ClassPathXmlApplicationContext applicationContext = null; try { applicationContext = getApplicationContext(); WilmaEngine wilmaEngine = applicationContext.getBean(WilmaEngine.class); WilmaServiceListener wilmaServiceListener = applicationContext.getBean(WilmaServiceListener.class); wilmaEngine.addListener(wilmaServiceListener, MoreExecutors.directExecutor()); wilmaEngine.start(); } catch (Exception e) { logErrorByTypeOfException(e); closeApplicationContext(applicationContext); } } }
WilmaBootstrap { public void bootstrap() { ClassPathXmlApplicationContext applicationContext = null; try { applicationContext = getApplicationContext(); WilmaEngine wilmaEngine = applicationContext.getBean(WilmaEngine.class); WilmaServiceListener wilmaServiceListener = applicationContext.getBean(WilmaServiceListener.class); wilmaEngine.addListener(wilmaServiceListener, MoreExecutors.directExecutor()); wilmaEngine.start(); } catch (Exception e) { logErrorByTypeOfException(e); closeApplicationContext(applicationContext); } } WilmaBootstrap(final ApplicationContextFactory applicationContextFactory); }
WilmaBootstrap { public void bootstrap() { ClassPathXmlApplicationContext applicationContext = null; try { applicationContext = getApplicationContext(); WilmaEngine wilmaEngine = applicationContext.getBean(WilmaEngine.class); WilmaServiceListener wilmaServiceListener = applicationContext.getBean(WilmaServiceListener.class); wilmaEngine.addListener(wilmaServiceListener, MoreExecutors.directExecutor()); wilmaEngine.start(); } catch (Exception e) { logErrorByTypeOfException(e); closeApplicationContext(applicationContext); } } WilmaBootstrap(final ApplicationContextFactory applicationContextFactory); void bootstrap(); }
WilmaBootstrap { public void bootstrap() { ClassPathXmlApplicationContext applicationContext = null; try { applicationContext = getApplicationContext(); WilmaEngine wilmaEngine = applicationContext.getBean(WilmaEngine.class); WilmaServiceListener wilmaServiceListener = applicationContext.getBean(WilmaServiceListener.class); wilmaEngine.addListener(wilmaServiceListener, MoreExecutors.directExecutor()); wilmaEngine.start(); } catch (Exception e) { logErrorByTypeOfException(e); closeApplicationContext(applicationContext); } } WilmaBootstrap(final ApplicationContextFactory applicationContextFactory); void bootstrap();  }