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