@Test
public void add_a_children_components_embedded_in_a_container_with_buttons_when_visiting_a_multiple_node_contract_input()
        throws Exception {

    Page page = new Page();
    new ContractInputVisitorImpl(page, contractInputToWidgetMapper).visit(
            (NodeContractInput) ContractInputBuilder.aNodeContractInput("employee").withInput(
                    ContractInputBuilder.aStringContractInput("firstName"),
                    ContractInputBuilder.aStringContractInput("lastName")).mulitple().build());
    assertThat(page.getRows()).hasSize(3);//one for the container label, one for the container,one for the button bar
    List<Element> firstRow = page.getRows().get(0);
    assertThat(firstRow).hasSize(1);
    assertThat(firstRow.get(0)).isInstanceOf(Component.class);
    assertThat(((Component) firstRow.get(0)).getId()).isEqualTo("pbTitle");
    assertThat(firstRow.get(0).getPropertyValues()).contains(
            entry(ParameterConstants.TEXT_PARAMETER, aInterpolationPropertyValue("Employee")));
    List<Element> secondRow = page.getRows().get(1);
    assertThat(secondRow).hasSize(1);
    assertThat(secondRow.get(0)).isInstanceOf(Container.class);
    Container container = (Container) secondRow.get(0);
    assertThat(container.getRows()).hasSize(3);
    assertThat(container.getRows().get(0)).hasSize(1);
    Component firstNameComponent = (Component) container.getRows().get(0).get(0);
    assertThat(firstNameComponent.getId()).isEqualTo("pbInput");
    assertThat(firstNameComponent.getPropertyValues()).contains(
            entry(ParameterConstants.LABEL_PARAMETER, aInterpolationPropertyValue("First Name")));
    assertThat(container.getRows().get(1)).hasSize(1);
    Component lastNameComponent = (Component) container.getRows().get(1).get(0);
    assertThat(lastNameComponent.getId()).isEqualTo("pbInput");
    assertThat(lastNameComponent.getPropertyValues()).contains(
            entry(ParameterConstants.LABEL_PARAMETER, aInterpolationPropertyValue("Last Name")));
    assertThat(container.getRows().get(2)).hasSize(1);
    Component removeButton = (Component) container.getRows().get(2).get(0);
    assertThat(removeButton.getId()).isEqualTo("pbButton");
    List<Element> thirdRow = page.getRows().get(2);
    assertThat(thirdRow).hasSize(1);
    Component addButton = (Component) thirdRow.get(0);
    assertThat(addButton.getId()).isEqualTo("pbButton");
    assertThat(addButton.getPropertyValues().get("valueToAdd").getValue()).isEqualTo("{" + System.lineSeparator() +
            "  \"firstName\" : \"\"," + System.lineSeparator() +
            "  \"lastName\" : \"\"" + System.lineSeparator() +
            "}");
}