ConfigurableModelFactory extends AbstractConfigurableSingleStrategy<WroModelFactory, ModelFactoryProvider> implements WroModelFactory { @Override protected WroModelFactory getDefaultStrategy() { try { LOG.debug("Trying to use SmartWroModelFactory as default model factory"); final Class<? extends WroModelFactory> smartFactoryClass = Class.forName( "ro.isdc.wro.extensions.model.factory.SmartWroModelFactory").asSubclass(WroModelFactory.class); return smartFactoryClass.getDeclaredConstructor().newInstance(); } catch (final Exception e) { LOG.debug("SmartWroModelFactory is not available. Using default model factory."); LOG.debug("Reason: {}", e.getMessage()); } return new XmlModelFactory(); }  WroModel create(); void destroy(); static final String KEY; }
@Test public void shouldUseCorrectDefaultStrategy() { assertEquals(XmlModelFactory.class, victim.getDefaultStrategy().getClass()); }