Search in sources :

Example 1 with ServerTemplateUpdated

use of org.kie.server.controller.api.model.events.ServerTemplateUpdated in project kie-wb-common by kiegroup.

the class ServerManagementBrowserPresenterTest method testOnServerTemplateUpdated.

@Test
public void testOnServerTemplateUpdated() {
    final ServerTemplate serverTemplate = new ServerTemplate("ServerTemplateId", "ServerTemplateName");
    presenter.onServerTemplateUpdated(new ServerTemplateUpdated(serverTemplate));
    final ArgumentCaptor<Collection> serverTemplateKeysCaptor = ArgumentCaptor.forClass(Collection.class);
    verify(navigationPresenter).setup(eq(serverTemplate), serverTemplateKeysCaptor.capture());
    final Collection<ServerTemplateKey> serverTemplateKeys = serverTemplateKeysCaptor.getValue();
    assertEquals(1, serverTemplateKeys.size());
    assertTrue(serverTemplateKeys.contains(serverTemplate));
    final ArgumentCaptor<ServerTemplateSelected> templateSelectedCaptor = ArgumentCaptor.forClass(ServerTemplateSelected.class);
    verify(serverTemplateSelectedEvent).fire(templateSelectedCaptor.capture());
    assertEquals(serverTemplate, templateSelectedCaptor.getValue().getServerTemplateKey());
}
Also used : ServerTemplateKey(org.kie.server.controller.api.model.spec.ServerTemplateKey) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) Collection(java.util.Collection) ServerTemplateSelected(org.kie.workbench.common.screens.server.management.client.events.ServerTemplateSelected) ServerTemplateUpdated(org.kie.server.controller.api.model.events.ServerTemplateUpdated) Test(org.junit.Test)

Example 2 with ServerTemplateUpdated

use of org.kie.server.controller.api.model.events.ServerTemplateUpdated in project kie-wb-common by kiegroup.

the class ServerNavigationPresenterTest method testOnServerTemplateUpdated.

@Test
public void testOnServerTemplateUpdated() {
    final ServerTemplate serverTemplate = new ServerTemplate("ServerTemplateKeyId", "ServerTemplateKeyName");
    presenter.onServerTemplateUpdated(new ServerTemplateUpdated(serverTemplate));
    verify(view).addTemplate(serverTemplate.getId(), serverTemplate.getName());
}
Also used : AddNewServerTemplate(org.kie.workbench.common.screens.server.management.client.events.AddNewServerTemplate) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) ServerTemplateUpdated(org.kie.server.controller.api.model.events.ServerTemplateUpdated) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ServerTemplateUpdated (org.kie.server.controller.api.model.events.ServerTemplateUpdated)2 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)2 Collection (java.util.Collection)1 ServerTemplateKey (org.kie.server.controller.api.model.spec.ServerTemplateKey)1 AddNewServerTemplate (org.kie.workbench.common.screens.server.management.client.events.AddNewServerTemplate)1 ServerTemplateSelected (org.kie.workbench.common.screens.server.management.client.events.ServerTemplateSelected)1