ContractInputToWidgetMapper { public Component createRemoveButton() { ButtonWidget removeButton = parametrizedWidgetFactory.createRemoveButton(); return removeButton.toComponent(dimensionFactory); } @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_collection_property_of_remove_button_with_iterator_if_in_a_repeated_container() throws Exception { ContractInputToWidgetMapper contractInputToWidgetMapper = makeContractInputToWidgetMapper(); ContractInput skills = aNodeContractInput("skills").mulitple().build(); aNodeContractInput("employee").mulitple().withInput(skills); Component button = contractInputToWidgetMapper.createRemoveButton(); PropertyValue repeatedCollectionPropetyValue = button.getPropertyValues().get("collectionToModify"); assertThat(repeatedCollectionPropetyValue.getType()).isEqualTo("variable"); assertThat(repeatedCollectionPropetyValue.getValue()).isEqualTo("$collection"); }