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