ServerTemplateSelectorMenuBuilder implements MenuFactory.CustomMenuBuilder { public void onServerTemplateUpdated(@Observes final ServerTemplateUpdated serverTemplateUpdated) { if (serverTemplateUpdated.getServerTemplate().getServerInstanceKeys().isEmpty()) { loadServerTemplates(); } }  @PostConstruct void init(); @Override void push(MenuFactory.CustomMenuBuilder element); @Override MenuItem build(); ServerTemplateSelectorElementView getView(); void onServerTemplateDeleted(@Observes final ServerTemplateDeleted serverTemplateDeleted); void onServerTemplateUpdated(@Observes final ServerTemplateUpdated serverTemplateUpdated); void onKieServerDataSetRegistered(@Observes final KieServerDataSetRegistered kieServerDataSetRegistered); @Inject void setSpecManagementService(final Caller<SpecManagementService> specManagementService); ServerTemplate getSelectedServerTemplate(); String getSelectedServerTemplateId();  }
@Test public void testServerTemplateUpdatedWithServerInstance() { final String serverTemplateId = "id1"; final ServerTemplate st1 = new ServerTemplate(serverTemplateId, "kie-server-template1"); st1.addServerInstance(new ServerInstanceKey()); when(specManagementService.listServerTemplates()).thenReturn(new ServerTemplateList(singletonList(st1))); serverTemplateSelectorMenuBuilder.onServerTemplateUpdated(new ServerTemplateUpdated(st1)); verifyNoMoreInteractions(view); }