@Test
public void should_create_read_only_widget_for_date_input() {

    DataReference dataReference = new DataReference("reference", LocalDate.class.getName());
    LeafContractInput input = new LeafContractInput("readOnlyDate", LocalDate.class);
    input.setReadonly(true);
    input.setDataReference(dataReference);
    input.setMode(EditMode.EDIT);
    AbstractParametrizedWidget widget = createFactory().createParametrizedWidget(input);
    assertThat(widget).isInstanceOf(TextWidget.class);
    assertThat(widget.getHidden()).isEqualTo("!reference");
    assertThat(((TextWidget) widget).isLabelHidden()).isFalse();
    assertThat(((TextWidget) widget).getLabel()).isEqualTo("Reference");
    assertThat(((TextWidget) widget).getText()).isEqualTo("{{reference|uiDate}}");
}