ParameterGenerationModel extends AbstractModel { public boolean isEnabled() { PushDownOptimizationMeta meta = getSelectedOptimization(); return meta != null && meta.isEnabled(); } ParameterGenerationModel( ParameterGenerationFactory factory, DataServiceModel dialogModel ); void add( PushDownOptimizationMeta meta ); void remove( PushDownOptimizationMeta meta ); ImmutableMap<String, PushDownOptimizationMeta> getParameterMap(); void setParameterMap( Map<String, PushDownOptimizationMeta> map ); String getSelectedParameter(); PushDownOptimizationMeta getSelectedOptimization(); ParameterGeneration getParameterGeneration(); void setSelectedParameter( final String selectedParameter ); @Override Map<String, Object> snapshot(); DataServiceModel getDialogModel(); String getSelectedStep(); void setSelectedStep( String stepName ); void setEnabled( boolean enabled ); boolean isEnabled(); ImmutableList<SourceTargetAdapter> getMappings();  }
@Test public void testIsEnabled() throws Exception { createParameterGeneration( "parameter" ).setEnabled( false ); model.updateParameterMap(); assertThat( model.isEnabled(), is( false ) ); model.setSelectedParameter( "parameter" ); assertThat( model.isEnabled(), is( false ) ); verify( changeSupport ).firePropertyChange( "enabled", null, Boolean.FALSE ); model.setEnabled( true ); assertThat( model.isEnabled(), is( true ) ); assertThat( model.getSelectedOptimization().isEnabled(), is( true ) ); verify( changeSupport ).firePropertyChange( "enabled", Boolean.FALSE, Boolean.TRUE ); }