@Test public void testLoadContainersEmpty() { presenter.loadContainers(containerSpecData); verifyLoad(true, 1); }
@Test public void testLoadContainersOnlyOnSelectedContainerEvent() { ContainerSpec containerSpec1 = new ContainerSpec("containerId1", "containerName", serverTemplateKey, releaseId, KieContainerStatus.STOPPED, new HashMap<Capability, ContainerConfig>()); presenter.setContainerSpec(containerSpec1); presenter.loadContainers(containerSpecData); verifyLoad(true, 0); presenter.setContainerSpec(containerSpec); presenter.loadContainers(containerSpecData); verifyLoad(true, 1); }
@Test public void testLoad() { when(runtimeManagementService.getContainersByContainerSpec( serverTemplateKey.getId(), containerSpec.getId())).thenReturn(containerSpecData); presenter.load(new ContainerSpecSelected(containerSpec)); verifyLoad(true, 1); }
@Test public void testLoadContainers() { final Container container = new Container("containerSpecId", "containerName", new ServerInstanceKey(), Collections.<Message>emptyList(), null, null); containerSpecData.getContainers().add(container); presenter.loadContainers(containerSpecData); verifyLoad(true, 1); }
@Test public void testRefresh() { when(runtimeManagementService.getContainersByContainerSpec( serverTemplateKey.getId(), containerSpec.getId())).thenReturn(containerSpecData); presenter.loadContainers(containerSpecData); presenter.refresh(); verifyLoad(true, 2); }
@Test public void testOnRefresh() { when(runtimeManagementService.getContainersByContainerSpec( serverTemplateKey.getId(), containerSpec.getId())).thenReturn(containerSpecData); presenter.onRefresh(new RefreshRemoteServers(containerSpec)); verifyLoad(true, 1); }
@Test public void testLoadContainersNonStoped() { final Container container = new Container("containerSpecId", "containerName", new ServerInstanceKey(), Collections.<Message>emptyList(), null, null); container.setStatus(KieContainerStatus.STARTED); containerSpecData.getContainers().add(container); presenter.loadContainers(containerSpecData); verifyLoad(false, 1); }