Search in sources :

Example 1 with ServerTemplateKeyList

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

the class ServerManagementBrowserPresenterTest method testOnDelete.

@Test
public void testOnDelete() {
    final ServerInstanceKey serverInstanceKey = new ServerInstanceKey("serverInstanceKeyId", "serverName", "serverInstanceId", "url");
    final ServerTemplate serverTemplate = new ServerTemplate("ServerTemplateId", "ServerTemplateName");
    serverTemplate.addServerInstance(serverInstanceKey);
    when(serverTemplatePresenter.getCurrentServerTemplate()).thenReturn(serverTemplate);
    final ServerTemplateKey serverTemplateKey = new ServerTemplateKey("ServerTemplateKeyId", "ServerTemplateKeyName");
    final List<ServerTemplateKey> serverTemplateKeys = Collections.singletonList(serverTemplateKey);
    when(specManagementService.listServerTemplateKeys()).thenReturn(new ServerTemplateKeyList(serverTemplateKeys));
    presenter.onDelete(new ServerInstanceDeleted(serverInstanceKey.getServerInstanceId()));
    verify(navigationPresenter).setup(serverTemplateKey, serverTemplateKeys);
    final ArgumentCaptor<ServerTemplateSelected> templateSelectedCaptor = ArgumentCaptor.forClass(ServerTemplateSelected.class);
    verify(serverTemplateSelectedEvent).fire(templateSelectedCaptor.capture());
    assertEquals(serverTemplateKey, templateSelectedCaptor.getValue().getServerTemplateKey());
}
Also used : ServerTemplateKey(org.kie.server.controller.api.model.spec.ServerTemplateKey) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) ServerInstanceDeleted(org.kie.server.controller.api.model.events.ServerInstanceDeleted) ServerTemplateSelected(org.kie.workbench.common.screens.server.management.client.events.ServerTemplateSelected) ServerInstanceKey(org.kie.server.controller.api.model.runtime.ServerInstanceKey) ServerTemplateKeyList(org.kie.server.controller.api.model.spec.ServerTemplateKeyList) Test(org.junit.Test)

Example 2 with ServerTemplateKeyList

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

the class ServerManagementBrowserPresenterTest method testOnOpen.

@Test
public void testOnOpen() {
    final ServerTemplateKey serverTemplateKey = new ServerTemplateKey("ServerTemplateKeyId", "ServerTemplateKeyName");
    final List<ServerTemplateKey> serverTemplateKeys = Collections.singletonList(serverTemplateKey);
    when(specManagementService.listServerTemplateKeys()).thenReturn(new ServerTemplateKeyList(serverTemplateKeys));
    presenter.onOpen();
    verify(navigationPresenter).setup(serverTemplateKey, serverTemplateKeys);
    final ArgumentCaptor<ServerTemplateSelected> templateSelectedCaptor = ArgumentCaptor.forClass(ServerTemplateSelected.class);
    verify(serverTemplateSelectedEvent).fire(templateSelectedCaptor.capture());
    assertEquals(serverTemplateKey, templateSelectedCaptor.getValue().getServerTemplateKey());
}
Also used : ServerTemplateKey(org.kie.server.controller.api.model.spec.ServerTemplateKey) ServerTemplateSelected(org.kie.workbench.common.screens.server.management.client.events.ServerTemplateSelected) ServerTemplateKeyList(org.kie.server.controller.api.model.spec.ServerTemplateKeyList) Test(org.junit.Test)

Example 3 with ServerTemplateKeyList

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

the class ServerManagementBrowserPresenterTest method testOnServerDeleted.

@Test
public void testOnServerDeleted() {
    final ServerTemplateKey serverTemplateKey = new ServerTemplateKey("ServerTemplateKeyId", "ServerTemplateKeyName");
    final List<ServerTemplateKey> serverTemplateKeys = Collections.singletonList(serverTemplateKey);
    when(specManagementService.listServerTemplateKeys()).thenReturn(new ServerTemplateKeyList(serverTemplateKeys));
    presenter.onServerDeleted(new ServerTemplateDeleted());
    verify(navigationPresenter).setup(serverTemplateKey, serverTemplateKeys);
    final ArgumentCaptor<ServerTemplateSelected> templateSelectedCaptor = ArgumentCaptor.forClass(ServerTemplateSelected.class);
    verify(serverTemplateSelectedEvent).fire(templateSelectedCaptor.capture());
    assertEquals(serverTemplateKey, templateSelectedCaptor.getValue().getServerTemplateKey());
}
Also used : ServerTemplateKey(org.kie.server.controller.api.model.spec.ServerTemplateKey) ServerTemplateDeleted(org.kie.server.controller.api.model.events.ServerTemplateDeleted) ServerTemplateSelected(org.kie.workbench.common.screens.server.management.client.events.ServerTemplateSelected) ServerTemplateKeyList(org.kie.server.controller.api.model.spec.ServerTemplateKeyList) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 ServerTemplateKey (org.kie.server.controller.api.model.spec.ServerTemplateKey)3 ServerTemplateKeyList (org.kie.server.controller.api.model.spec.ServerTemplateKeyList)3 ServerTemplateSelected (org.kie.workbench.common.screens.server.management.client.events.ServerTemplateSelected)3 ServerInstanceDeleted (org.kie.server.controller.api.model.events.ServerInstanceDeleted)1 ServerTemplateDeleted (org.kie.server.controller.api.model.events.ServerTemplateDeleted)1 ServerInstanceKey (org.kie.server.controller.api.model.runtime.ServerInstanceKey)1 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)1