ParameterGenerationModel extends AbstractModel { public String getSelectedStep() { PushDownOptimizationMeta meta = getSelectedOptimization(); return meta != null ? meta.getStepName() : null; } 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 testGetSelectedStep() throws Exception { createParameterGeneration( "parameter" ).setStepName( "firstStep" ); model.updateParameterMap(); assertThat( model.getSelectedStep(), nullValue() ); model.setSelectedParameter( "parameter" ); assertThat( model.getSelectedStep(), is( "firstStep" ) ); verify( changeSupport ).firePropertyChange( "selectedStep", null, "firstStep" ); model.setSelectedStep( "secondStep" ); assertThat( model.getSelectedStep(), is( "secondStep" ) ); assertThat( model.getSelectedOptimization().getStepName(), is( "secondStep" ) ); verify( changeSupport ).firePropertyChange( "selectedStep", "firstStep", "secondStep" ); }