@Test
public void should_generate_master_details_when_nested_object_is_loading_on_composition_and_eager() {

    BusinessObjectContainer boc = new BusinessObjectContainer();
    BusinessDataToWidgetMapper businessDataToWidgetMapper = makeBusinessDataToWidgetMapper(boc);
    NodeBusinessObjectInput node = aNestedObjectInCompositionAndEager();
    node.setMultiple(true);
    businessDataToWidgetMapper.generateMasterDetailsPattern(node, boc.getContainer().getRows());
    Component title = (Component) boc.getContainer().getRows().get(0).get(0);
    assertThat(title.getId()).isEqualTo("pbTitle");
    PropertyValue titleCollectionPropertyValue = title.getPropertyValues().get("text");
    assertThat(titleCollectionPropertyValue.getType()).isEqualTo("interpolation");
    assertThat(titleCollectionPropertyValue.getValue()).isEqualTo("Sport");
    Component tableWidget = (Component) boc.getContainer().getRows().get(1).get(0);
    assertThat(tableWidget.getId()).isEqualTo("pbTable");
    Map<String, PropertyValue> tableCollectionPropertyValue = tableWidget.getPropertyValues();
    assertThat(tableCollectionPropertyValue.get("content").getValue()).isEqualTo("person_selected.sport");
    assertThat(tableCollectionPropertyValue.get("selectedRow").getValue()).isEqualTo("person_sport_selected");
    assertThat(tableCollectionPropertyValue.get("headers").getValue()).isEqualTo(Arrays.asList("Name", "Need Balls"));
    Map<String, Variable> variables = boc.getBusinessObjectVariable();
    assertThat(variables.size()).isEqualTo(1);
    assertThat(variables.get("person_sport_selected")).isNotNull();
}