WroManagerFactoryDecorator extends AbstractDecorator<WroManagerFactory> implements WroManagerFactory, StandaloneContextAware { public void initialize(final StandaloneContext standaloneContext) { if (getOriginalDecoratedObject() instanceof StandaloneContextAware) { ((StandaloneContextAware) getOriginalDecoratedObject()).initialize(standaloneContext); } } WroManagerFactoryDecorator(final WroManagerFactory managerFactory); WroManager create(); void onCachePeriodChanged(final long value); void onModelPeriodChanged(final long value); void destroy(); void initialize(final StandaloneContext standaloneContext);  }
@Test public void shouldInitializeStandaloneContextWhenDecoratedIsStandaloneContextAware() { final DefaultStandaloneContextAwareManagerFactory decorated = Mockito.spy(new DefaultStandaloneContextAwareManagerFactory()); victim = new WroManagerFactoryDecorator(decorated); final StandaloneContext standaloneContext = new StandaloneContext(); victim.initialize(standaloneContext); Mockito.verify(decorated).initialize(Mockito.eq(standaloneContext)); }