Search in sources :

Example 1 with ServerContainerEmptyPresenter

use of org.kie.workbench.common.screens.server.management.client.container.empty.ServerContainerEmptyPresenter in project kie-wb-common by kiegroup.

the class ServerManagementBrowserPresenterTest method testOnSelectedServerTemplate.

@Test
public void testOnSelectedServerTemplate() {
    final ServerTemplate serverTemplate = new ServerTemplate("ServerTemplateId", "ServerTemplateName");
    final ServerTemplateKey serverTemplateKey = new ServerTemplateKey("ServerTemplateKeyId", "ServerTemplateKeyName");
    when(specManagementService.getServerTemplate(serverTemplateKey.getId())).thenReturn(serverTemplate);
    final ServerTemplatePresenter.View serverView = mock(ServerTemplatePresenter.View.class);
    when(serverTemplatePresenter.getView()).thenReturn(serverView);
    final ServerContainerEmptyPresenter.View serverEmptyView = mock(ServerContainerEmptyPresenter.View.class);
    when(serverContainerEmptyPresenter.getView()).thenReturn(serverEmptyView);
    presenter.onSelected(new ServerTemplateSelected(serverTemplateKey));
    verify(view).setServerTemplate(serverView);
    verify(specManagementService).getServerTemplate(serverTemplateKey.getId());
    verify(serverContainerEmptyPresenter).setTemplate(serverTemplate);
    verify(view).setContent(serverEmptyView);
    verify(serverTemplatePresenter).setup(serverTemplate, null);
}
Also used : ServerTemplateKey(org.kie.server.controller.api.model.spec.ServerTemplateKey) ServerTemplatePresenter(org.kie.workbench.common.screens.server.management.client.navigation.template.ServerTemplatePresenter) ServerContainerEmptyPresenter(org.kie.workbench.common.screens.server.management.client.container.empty.ServerContainerEmptyPresenter) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) ServerTemplateSelected(org.kie.workbench.common.screens.server.management.client.events.ServerTemplateSelected) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)1 ServerTemplateKey (org.kie.server.controller.api.model.spec.ServerTemplateKey)1 ServerContainerEmptyPresenter (org.kie.workbench.common.screens.server.management.client.container.empty.ServerContainerEmptyPresenter)1 ServerTemplateSelected (org.kie.workbench.common.screens.server.management.client.events.ServerTemplateSelected)1 ServerTemplatePresenter (org.kie.workbench.common.screens.server.management.client.navigation.template.ServerTemplatePresenter)1