String testLabel = "Label [%s]";
Widget w = mock(Widget.class);
Item item = mock(Item.class);
when(w.getLabel()).thenReturn(testLabel);
when(w.getItem()).thenReturn("Item");
when(w.eClass()).thenReturn(SitemapFactory.eINSTANCE.createText().eClass());
when(registry.getItem("Item")).thenThrow(new ItemNotFoundException("Item"));
when(item.getState()).thenReturn(new StringType("State"));
String label = uiRegistry.getLabel(w);
assertEquals("Label [-]", label);
}