FixBondsTypesVisitor implements ElementVisitor<Void> { @Override public Void visit(Container container) { for (Element element : concat(container.getRows())) { element.accept(this); } return null; } FixBondsTypesVisitor(List<Property> properties); @Override Void visit(Container container); @Override Void visit(FormContainer formContainer); @Override Void visit(TabsContainer tabsContainer); @Override Void visit(ModalContainer modalContainer); @Override Void visit(TabContainer tabContainer); @Override Void visit(Component component); @Override Void visit(Previewable previewable);  }
@Test public void should_fix_component_bond_when_visiting_it() { fixBondsTypesVisitor.visit(component); assertThat(component.getPropertyValues().get("bar").getType()).isEqualTo("constant"); }
@Test public void should_not_change_bond_if_type_in_inbound_expression_value() { fixBondsTypesVisitor.visit(component); assertThat(component.getPropertyValues().get("foo").getType()).isEqualTo("constant"); }
@Test public void should_visit_container_rows() { fixBondsTypesVisitor.visit(aContainer().with(component).build()); assertThat(component.getPropertyValues().get("bar").getType()).isEqualTo("constant"); }
@Test public void should_visit_previewable_rows() { fixBondsTypesVisitor.visit(aPage().with(component).build()); assertThat(component.getPropertyValues().get("bar").getType()).isEqualTo("constant"); }
@Test public void should_visit_container_from_tabs_container() { fixBondsTypesVisitor.visit(aTabsContainer().with(aTabContainer().with(aContainer().with(component))).build()); assertThat(component.getPropertyValues().get("bar").getType()).isEqualTo("constant"); }