ParametrizedWidgetFactory { public TitleWidget createTitle(String title) { TitleWidget titleComponent = new TitleWidget(); titleComponent.setText(title); return titleComponent; } ParametrizedWidgetFactory(); AbstractParametrizedWidget createParametrizedWidget(ContractInput input); boolean isSupported(ContractInput input); WidgetContainer createWidgetContainer(ContractInput contractInput); WidgetContainer createWidgetContainer(); TitleWidget createTitle(String title); TitleWidget createTitle(ContractInput input); ButtonWidget createSubmitButton(ButtonAction actionType); ButtonWidget createAddButton(ContractInput contractInput); ButtonWidget createRemoveButton(); LinkWidget createLink(String text, String url, ButtonStyle style); static final String ITEM_ITERATOR; }
@Test public void create_a_label_component_with_contract_input_with_full_with() throws Exception { ParametrizedWidgetFactory elementFactory = createFactory(); AbstractParametrizedWidget component = elementFactory.createTitle(aStringContractInput("isValid")); assertThat(component.getDimension()).isEqualTo(12); }