ContractInputToWidgetMapper { public Container toContainer(NodeContractInput nodeContractInput, List<List<Element>> rows) { rows.add(Collections.<Element> singletonList( parametrizedWidgetFactory.createTitle(nodeContractInput).toComponent(dimensionFactory))); return nodeContractInput.isMultiple() ? toMultipleContainer(nodeContractInput) : toSimpleContainer(nodeContractInput); } @Inject  ContractInputToWidgetMapper(DimensionFactory dimensionFactory, JacksonObjectMapper objectMapperWrapper); Element toElement(ContractInput contractInput, List<List<Element>> rows); Element toDocument(LeafContractInput contractInput); Container toContainer(NodeContractInput nodeContractInput, List<List<Element>> rows); Component createSubmitButton(ButtonAction actionType); Component createSubmitErrorAlert(); boolean canCreateComponent(ContractInput contractInput); Component createRemoveButton(); Component createAddButton(ContractInput contractInput);  }
@Test public void should_configure_value_property_of_container_with_sentData_when_generating_a_multiple_node_input() throws Exception { ContractInputToWidgetMapper contractInputToWidgetMapper = makeContractInputToWidgetMapper(); Container container = contractInputToWidgetMapper.toContainer( (NodeContractInput) aNodeContractInput("employee").mulitple().build(), new ArrayList<List<Element>>()); PropertyValue repeatedCollectionPropetyValue = container.getPropertyValues().get("repeatedCollection"); assertThat(repeatedCollectionPropetyValue.getType()).isEqualTo("variable"); assertThat(repeatedCollectionPropetyValue.getValue()).isEqualTo("formInput.employee"); }