ParameterGenerationController extends AbstractController { public void initBindings( List<String> supportedSteps ) { BindingFactory bindingFactory = getBindingFactory(); XulMenuList<String> stepList = getStepMenuList(); stepList.setElements( supportedSteps ); getElementById( "param_gen_add" ).setDisabled( supportedSteps.isEmpty() ); bindingFactory.setBindingType( Binding.Type.BI_DIRECTIONAL ); bindingFactory.createBinding( model, "selectedParameter", "param_gen_list", "selectedItem" ); bindingFactory.createBinding( model, "selectedStep", stepList, "value" ); bindingFactory.createBinding( model, "enabled", "param_gen_enabled", "checked", not() ); bindingFactory.setBindingType( Binding.Type.ONE_WAY ); bindingFactory.createBinding( model, "parameterMap", "param_gen_list", "elements", keySet() ); bindingFactory.createBinding( model, "selectedParameter", "param_gen_edit", "disabled", stringIsEmpty() ); bindingFactory.createBinding( model, "selectedParameter", "param_gen_remove", "disabled", stringIsEmpty() ); bindingFactory.createBinding( model, "selectedParameter", "param_gen_enabled", "disabled", stringIsEmpty() ); bindingFactory.createBinding( model, "enabled", "param_gen_step", "disabled", not() ); bindingFactory.createBinding( model, "enabled", "param_gen_mapping", "disabled", not() ); bindingFactory.createBinding( model, "mappings", "param_gen_mapping", "elements" ); model.updateParameterMap(); } ParameterGenerationController( ParameterGenerationFactory factory, ParameterGenerationModel model ); void initBindings( List<String> supportedSteps ); void runAutoGenerate(); void addParameter(); void editParameter(); void removeParameter();  }
@Test @SuppressWarnings( "unchecked" ) public void testInitBindings() throws Exception { List<String> supportedSteps = ImmutableList.of( "input" ); controller.initBindings( supportedSteps ); verify( addButton ).setDisabled( false ); verify( stepList ).setElements( supportedSteps ); verify( bindingFactory, atLeastOnce() ).createBinding( same( model ), anyString(), anyString(), anyString() ); verify( model ).updateParameterMap(); }