use of org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentPopup in project kie-wb-common by kiegroup.
the class SnapshotBuildAndDeployExecutorTest method testBuildAndDeployWithMultipleTemplates.
@Test
public void testBuildAndDeployWithMultipleTemplates() {
final ServerTemplate serverTemplate = new ServerTemplate(SERVER_TEMPLATE_ID, SERVER_TEMPLATE_NAME);
serverTemplate.setMode(KieServerMode.DEVELOPMENT);
final ServerTemplate serverTemplate2 = new ServerTemplate(SERVER_TEMPLATE_ID2, SERVER_TEMPLATE_NAME2);
serverTemplate2.setMode(KieServerMode.DEVELOPMENT);
when(specManagementServiceMock.listServerTemplates()).thenReturn(new ServerTemplateList(Arrays.asList(serverTemplate, serverTemplate2)));
runner.run(context);
verify(buildDialog).startBuild();
ArgumentCaptor<DeploymentPopup.Driver> driverArgumentCaptor = ArgumentCaptor.forClass(DeploymentPopup.Driver.class);
verify(deploymentPopup).show(driverArgumentCaptor.capture());
DeploymentPopup.Driver driver = driverArgumentCaptor.getValue();
driver.finish(context.getContainerId(), context.getContainerAlias(), SERVER_TEMPLATE_ID, true);
verify(buildDialog).showBusyIndicator(CONSTANTS.Building());
verifyNotification(ProjectEditorResources.CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS);
verifyNotification(ProjectEditorResources.CONSTANTS.DeploySuccessfulAndContainerStarted(), NotificationEvent.NotificationType.SUCCESS);
verify(notificationEvent, times(2)).fire(any(NotificationEvent.class));
verify(settings).save();
verify(buildDialog).stopBuild();
driver.cancel();
verify(buildDialog, times(2)).stopBuild();
}
use of org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentPopup in project kie-wb-common by kiegroup.
the class SnapshotRedeployExecutorTest method testRedeployWithMultipleTemplates.
@Test
public void testRedeployWithMultipleTemplates() {
final ServerTemplate serverTemplate = new ServerTemplate(SERVER_TEMPLATE_ID, SERVER_TEMPLATE_NAME);
serverTemplate.setMode(KieServerMode.DEVELOPMENT);
final ServerTemplate serverTemplate2 = new ServerTemplate(SERVER_TEMPLATE_ID2, SERVER_TEMPLATE_NAME2);
serverTemplate2.setMode(KieServerMode.DEVELOPMENT);
when(specManagementServiceMock.listServerTemplates()).thenReturn(new ServerTemplateList(Arrays.asList(serverTemplate, serverTemplate2)));
runner.run(context);
verify(buildDialog).startBuild();
ArgumentCaptor<DeploymentPopup.Driver> driverArgumentCaptor = ArgumentCaptor.forClass(DeploymentPopup.Driver.class);
verify(deploymentPopup).show(driverArgumentCaptor.capture());
DeploymentPopup.Driver driver = driverArgumentCaptor.getValue();
driver.finish(context.getContainerId(), context.getContainerAlias(), SERVER_TEMPLATE_ID, true);
verify(buildDialog).showBusyIndicator(CONSTANTS.Building());
verifyNotification(ProjectEditorResources.CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS);
verifyNotification(ProjectEditorResources.CONSTANTS.DeploySuccessfulAndContainerStarted(), NotificationEvent.NotificationType.SUCCESS);
verify(notificationEvent, times(2)).fire(any(NotificationEvent.class));
verify(settings).save();
verify(buildDialog).stopBuild();
driver.cancel();
verify(buildDialog, times(2)).stopBuild();
}
use of org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentPopup in project kie-wb-common by kiegroup.
the class ProductionBuildAndDeployExecutorTest method testBuildAndDeployWithMultipleTemplates.
@Test
public void testBuildAndDeployWithMultipleTemplates() {
final ServerTemplate serverTemplate = new ServerTemplate(SERVER_TEMPLATE_ID, SERVER_TEMPLATE_NAME);
serverTemplate.setMode(KieServerMode.PRODUCTION);
final ServerTemplate serverTemplate2 = new ServerTemplate(SERVER_TEMPLATE_ID2, SERVER_TEMPLATE_NAME2);
serverTemplate2.setMode(KieServerMode.PRODUCTION);
when(specManagementServiceMock.listServerTemplates()).thenReturn(new ServerTemplateList(Arrays.asList(serverTemplate, serverTemplate2)));
runner.run(context);
verify(buildDialog).startBuild();
ArgumentCaptor<DeploymentPopup.Driver> driverArgumentCaptor = ArgumentCaptor.forClass(DeploymentPopup.Driver.class);
verify(deploymentPopup).show(driverArgumentCaptor.capture());
DeploymentPopup.Driver driver = driverArgumentCaptor.getValue();
driver.finish(context.getContainerId(), context.getContainerAlias(), SERVER_TEMPLATE_ID, true);
verify(buildDialog).showBusyIndicator(CONSTANTS.Building());
verifyNotification(ProjectEditorResources.CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS);
verifyNotification(ProjectEditorResources.CONSTANTS.DeploySuccessfulAndContainerStarted(), NotificationEvent.NotificationType.SUCCESS);
verify(notificationEvent, times(2)).fire(any(NotificationEvent.class));
verify(buildDialog, times(1)).stopBuild();
driver.cancel();
verify(buildDialog, times(2)).stopBuild();
}
use of org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentPopup in project kie-wb-common by kiegroup.
the class ProductionBuildAndDeployExecutorTest method testBuildDeploySingleServerTemplateUpdatingExistingContainer.
@Test
public void testBuildDeploySingleServerTemplateUpdatingExistingContainer() {
final ServerTemplate serverTemplate = new ServerTemplate(SERVER_TEMPLATE_ID, SERVER_TEMPLATE_NAME);
serverTemplate.setMode(KieServerMode.DEVELOPMENT);
ContainerSpec spec = mock(ContainerSpec.class);
when(spec.getId()).thenReturn(context.getContainerId());
serverTemplate.setContainersSpec(Collections.singletonList(spec));
when(specManagementServiceMock.listServerTemplates()).thenReturn(new ServerTemplateList(new ServerTemplate[] { serverTemplate }));
runner.run(context);
verify(buildDialog).startBuild();
ArgumentCaptor<DeploymentPopup.Driver> driverArgumentCaptor = ArgumentCaptor.forClass(DeploymentPopup.Driver.class);
verify(deploymentPopup).show(driverArgumentCaptor.capture());
DeploymentPopup.Driver driver = driverArgumentCaptor.getValue();
driver.finish(context.getContainerId(), context.getContainerAlias(), SERVER_TEMPLATE_ID, true);
verify(buildDialog).showBusyIndicator(CONSTANTS.Building());
verifyNotification(ProjectEditorResources.CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS);
verify(specManagementServiceMock).updateContainerSpec(anyString(), any());
verifyNotification(ProjectEditorResources.CONSTANTS.DeploySuccessfulAndContainerUpdated(), NotificationEvent.NotificationType.SUCCESS);
verify(notificationEvent, times(2)).fire(any(NotificationEvent.class));
verify(buildDialog, times(1)).stopBuild();
driver.cancel();
verify(buildDialog, times(2)).stopBuild();
}
use of org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentPopup in project kie-wb-common by kiegroup.
the class ProductionBuildAndDeployExecutorTest method testBuildDeploySingleServerTemplateExistingContainer.
@Test
public void testBuildDeploySingleServerTemplateExistingContainer() {
final ServerTemplate serverTemplate = new ServerTemplate(SERVER_TEMPLATE_ID, SERVER_TEMPLATE_NAME);
serverTemplate.setMode(KieServerMode.PRODUCTION);
ContainerSpec spec = mock(ContainerSpec.class);
when(spec.getId()).thenReturn(context.getContainerId());
serverTemplate.setContainersSpec(Collections.singletonList(spec));
when(specManagementServiceMock.listServerTemplates()).thenReturn(new ServerTemplateList(new ServerTemplate[] { serverTemplate }));
runner.run(context);
verify(buildDialog).startBuild();
ArgumentCaptor<DeploymentPopup.Driver> driverArgumentCaptor = ArgumentCaptor.forClass(DeploymentPopup.Driver.class);
verify(deploymentPopup).show(driverArgumentCaptor.capture());
DeploymentPopup.Driver driver = driverArgumentCaptor.getValue();
driver.finish(context.getContainerId(), context.getContainerAlias(), SERVER_TEMPLATE_ID, true);
verify(buildDialog).showBusyIndicator(CONSTANTS.Building());
verifyNotification(ProjectEditorResources.CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS);
verify(specManagementServiceMock, never()).saveContainerSpec(anyString(), any());
verify(specManagementServiceMock, never()).updateContainerSpec(anyString(), any());
verifyNotification(ProjectEditorResources.CONSTANTS.DeploymentSkippedCannotUpdateDeploymentsOnProduction(), NotificationEvent.NotificationType.ERROR);
verify(notificationEvent, times(2)).fire(any(NotificationEvent.class));
verify(buildDialog, times(1)).stopBuild();
driver.cancel();
verify(buildDialog, times(2)).stopBuild();
}
Aggregations