@Test
public void should_create_read_only_widget_for_aggregated_input() {

    BusinessDataReference dataReference = new BusinessDataReference("aggregatedReference", Object.class.getName(),
            RelationType.AGGREGATION, LoadingType.EAGER);
    NodeContractInput parent = new NodeContractInput("aggregatedObject");
    parent.setDataReference(dataReference);
    parent.setMode(EditMode.EDIT);
    LeafContractInput input = new LeafContractInput(ContractInputDataHandler.PERSISTENCEID_INPUT_NAME, String.class);
    input.setReadonly(true);
    input.setMode(EditMode.EDIT);
    parent.addInput(input);
    AbstractParametrizedWidget widget = createFactory().createParametrizedWidget(input);
    assertThat(widget).isInstanceOf(TextWidget.class);
    assertThat(widget.getHidden()).isEqualTo("!aggregatedReference");
    assertThat(((TextWidget) widget).isLabelHidden()).isFalse();
    assertThat(((TextWidget) widget).getLabel()).isEqualTo("Aggregated Reference");
    assertThat(((TextWidget) widget).getText()).isEqualTo("{{aggregatedReference}}");
}