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);
}
Aggregations