ExternalComponentPropertiesEditor implements IsWidget { @PostConstruct public void init() { view.init(this); }  @PostConstruct void init(); void init(String componentId,
                     Map<String, String> settings,
                     Consumer<Map<String, String>> onPropertiesChange); void onPropertyChange(String key, String value); @Override Widget asWidget();  }
@Test public void testComponentNotFound() { String c1 = "c1"; when(externalComponentServiceMock.byId(matches(c1))).thenReturn(Optional.empty()); externalComponentPropertiesEditor.init(c1, Collections.emptyMap(), props -> { }); verify(view).componentNotFound(); }
@Test public void testNoProperties() { ExternalComponent c1 = new ExternalComponent("c1", "c1 name", "c1 icon", false, Collections.emptyList()); when(externalComponentServiceMock.byId(matches(c1.getId()))).thenReturn(Optional.of(c1)); externalComponentPropertiesEditor.init(c1.getId(), Collections.emptyMap(), props -> { }); verify(view).noPropertiesComponent(); }