Search in sources :

Example 6 with ContainerSpecSelected

use of org.kie.workbench.common.screens.server.management.client.events.ContainerSpecSelected in project kie-wb-common by kiegroup.

the class ContainerPresenterTest method testLoad.

@Test
public void testLoad() {
    when(runtimeManagementService.getContainersByContainerSpec(serverTemplateKey.getId(), containerSpec.getId())).thenReturn(containerSpecData);
    presenter.load(new ContainerSpecSelected(containerSpec));
    verifyLoad(true, 1);
}
Also used : ContainerSpecSelected(org.kie.workbench.common.screens.server.management.client.events.ContainerSpecSelected) Test(org.junit.Test)

Example 7 with ContainerSpecSelected

use of org.kie.workbench.common.screens.server.management.client.events.ContainerSpecSelected in project kie-wb-common by kiegroup.

the class ServerTemplatePresenterTest method testSetup.

@Test
public void testSetup() {
    final ServerTemplate serverTemplate = new ServerTemplate("ServerTemplateKeyId", "ServerTemplateKeyName");
    final ServerInstanceKey serverInstanceKey = new ServerInstanceKey("serverTemplateId", "serverName", "serverInstanceId", "url");
    serverTemplate.addServerInstance(serverInstanceKey);
    final ReleaseId releaseId = new ReleaseId("org.kie", "container", "1.0.0");
    final ContainerSpec containerSpec = new ContainerSpec("containerId", "containerName", serverTemplate, releaseId, KieContainerStatus.CREATING, null);
    serverTemplate.addContainerSpec(containerSpec);
    final ContainerSpec containerSpec1 = new ContainerSpec("containerId1", "containerName1", serverTemplate, new ReleaseId("org.kie", "container2", "1.0.0"), KieContainerStatus.CREATING, null);
    serverTemplate.addContainerSpec(containerSpec1);
    presenter.setup(serverTemplate, containerSpec);
    assertEquals(serverTemplate, presenter.getCurrentServerTemplate());
    verify(view).clear();
    verify(view).setTemplate(serverTemplate.getId(), serverTemplate.getName());
    verify(view).setProcessCapability(false);
    verify(view).setRulesCapability(false);
    verify(view).setPlanningCapability(false);
    verify(view).addContainer(eq(containerSpec.getServerTemplateKey().getId()), eq(containerSpec.getId()), eq(containerSpec.getContainerName()), any(Command.class));
    verify(view).addContainer(eq(containerSpec1.getServerTemplateKey().getId()), eq(containerSpec1.getId()), eq(containerSpec1.getContainerName()), any(Command.class));
    final ArgumentCaptor<ContainerSpecSelected> selectedCaptor = ArgumentCaptor.forClass(ContainerSpecSelected.class);
    verify(containerSpecSelectedEvent).fire(selectedCaptor.capture());
    assertEquals(containerSpec, selectedCaptor.getValue().getContainerSpecKey());
    verify(view).addServerInstance(eq(serverInstanceKey.getServerTemplateId()), eq(serverInstanceKey.getServerInstanceId()), eq(serverInstanceKey.getServerName()), any(Command.class));
}
Also used : ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) ParameterizedCommand(org.uberfire.mvp.ParameterizedCommand) Command(org.uberfire.mvp.Command) ContainerSpec(org.kie.server.controller.api.model.spec.ContainerSpec) ContainerSpecSelected(org.kie.workbench.common.screens.server.management.client.events.ContainerSpecSelected) ServerInstanceKey(org.kie.server.controller.api.model.runtime.ServerInstanceKey) ReleaseId(org.kie.server.api.model.ReleaseId) Test(org.junit.Test)

Aggregations

ContainerSpecSelected (org.kie.workbench.common.screens.server.management.client.events.ContainerSpecSelected)7 Test (org.junit.Test)5 ServerInstanceKey (org.kie.server.controller.api.model.runtime.ServerInstanceKey)3 ContainerSpecKey (org.kie.server.controller.api.model.spec.ContainerSpecKey)3 Command (org.uberfire.mvp.Command)3 ReleaseId (org.kie.server.api.model.ReleaseId)2 ContainerSpec (org.kie.server.controller.api.model.spec.ContainerSpec)2 ServerTemplateKey (org.kie.server.controller.api.model.spec.ServerTemplateKey)2 CardPresenter (org.kie.workbench.common.screens.server.management.client.widget.card.CardPresenter)2 BodyPresenter (org.kie.workbench.common.screens.server.management.client.widget.card.body.BodyPresenter)2 FooterPresenter (org.kie.workbench.common.screens.server.management.client.widget.card.footer.FooterPresenter)2 InfoTitlePresenter (org.kie.workbench.common.screens.server.management.client.widget.card.title.InfoTitlePresenter)2 LinkTitlePresenter (org.kie.workbench.common.screens.server.management.client.widget.card.title.LinkTitlePresenter)2 Message (org.kie.server.api.model.Message)1 Container (org.kie.server.controller.api.model.runtime.Container)1 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)1 ContainerPresenter (org.kie.workbench.common.screens.server.management.client.container.ContainerPresenter)1 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)1