ExternalComponentPropertiesEditor implements IsWidget { private void loadProperties(Optional<ExternalComponent> compOp) { loading.hideBusyIndicator(); if (compOp.isPresent()) { currentComp = compOp.get(); loadProperties(); } else { view.componentNotFound(); } }  @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 testLoadProperties() { ComponentParameter p1 = param("P1 CAT", "p1val", "text", "P1 Field", "p1", emptyList()); ComponentParameter p2 = param("P2 CAT", "p2val", "combo", "P2 Field", "p2", asList("V1", "V2")); ExternalComponent c1 = new ExternalComponent("c1", "c1 name", "c1 icon", false, asList(p1, p2)); when(externalComponentServiceMock.byId(matches(c1.getId()))).thenReturn(Optional.of(c1)); externalComponentPropertiesEditor.init(c1.getId(), new HashMap<>(), props -> { }); verify(view).addCategories(categoriesCaptor.capture()); Collection<PropertyEditorCategory> categories = categoriesCaptor.getValue(); assertEquals(3, categories.size()); }