@Test(expected = IllegalArgumentException.class) public void testNotMinijax() { final PersistenceFeature feature = new PersistenceFeature(); feature.configure(mock(FeatureContext.class)); }
@Override public boolean configure(final FeatureContext context) { if (!(context instanceof MinijaxApplicationContext)) { throw new IllegalArgumentException("Minijax PersistenceFeature only compatible with MinijaxApplication"); } final MinijaxApplicationContext app = (MinijaxApplicationContext) context; registerPersistence(app); return true; }
PersistenceFeature implements Feature { @Override public boolean configure(final FeatureContext context) { if (!(context instanceof MinijaxApplicationContext)) { throw new IllegalArgumentException("Minijax PersistenceFeature only compatible with MinijaxApplication"); } final MinijaxApplicationContext app = (MinijaxApplicationContext) context; registerPersistence(app); return true; } }
PersistenceFeature implements Feature { @Override public boolean configure(final FeatureContext context) { if (!(context instanceof MinijaxApplicationContext)) { throw new IllegalArgumentException("Minijax PersistenceFeature only compatible with MinijaxApplication"); } final MinijaxApplicationContext app = (MinijaxApplicationContext) context; registerPersistence(app); return true; }  }
PersistenceFeature implements Feature { @Override public boolean configure(final FeatureContext context) { if (!(context instanceof MinijaxApplicationContext)) { throw new IllegalArgumentException("Minijax PersistenceFeature only compatible with MinijaxApplication"); } final MinijaxApplicationContext app = (MinijaxApplicationContext) context; registerPersistence(app); return true; }  @Override boolean configure(final FeatureContext context); void registerPersistence(final MinijaxApplicationContext app); }
PersistenceFeature implements Feature { @Override public boolean configure(final FeatureContext context) { if (!(context instanceof MinijaxApplicationContext)) { throw new IllegalArgumentException("Minijax PersistenceFeature only compatible with MinijaxApplication"); } final MinijaxApplicationContext app = (MinijaxApplicationContext) context; registerPersistence(app); return true; }  @Override boolean configure(final FeatureContext context); void registerPersistence(final MinijaxApplicationContext app);  }