use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class DeploymentPopupTest method testOnCancel.
@Test
public void testOnCancel() {
context = new BuildExecutionContext(CONTAINER1, CONTAINER1, null);
context.setServerTemplate(template1);
DefaultDeploymentPopupDriver driver = new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.MULTIPLE_SERVER_FORCED, () -> templates, callback, cancelCallback);
popup.show(driver);
popup.onCancel();
verify(view).hide();
verify(cancelCallback).execute();
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class DeploymentPopupTest method testMultipleTemplateWithValidationFailure.
@Test
public void testMultipleTemplateWithValidationFailure() {
context = new BuildExecutionContext(CONTAINER1, CONTAINER1, null);
context.setServerTemplate(template1);
DefaultDeploymentPopupDriver driver = new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.MULTIPLE_SERVER, () -> templates, callback, cancelCallback);
popup.show(driver);
verify(view).initContainerId(eq(CONTAINER1), eq(true));
verify(view).initContainerAlias(eq(CONTAINER1), eq(true));
verify(view).initStartContainer(eq(true), eq(true));
verify(view).initServerTemplates(any(), any());
verify(view, never()).disableServerTemplates();
initViewWithValues(CONTAINER1, null, context.isStartContainer(), TEMPLATE1_ID);
popup.onOk();
verify(view).clearValidations();
verify(view).invalidateContainerId(any());
verify(view).invalidateContainerAlias(any());
verify(view, never()).hide();
verify(callback, never()).execute();
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class DeploymentPopupTest method testMultipleForcedTemplateWithValidationFailure.
@Test
public void testMultipleForcedTemplateWithValidationFailure() {
context = new BuildExecutionContext(CONTAINER1, CONTAINER1, null);
context.setServerTemplate(template1);
DefaultDeploymentPopupDriver driver = new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.MULTIPLE_SERVER_FORCED, () -> templates, callback, cancelCallback);
popup.show(driver);
verify(view).initContainerId(eq(CONTAINER1), eq(false));
verify(view).initContainerAlias(eq(CONTAINER1), eq(false));
verify(view).initStartContainer(eq(true), eq(false));
verify(view).initServerTemplates(any(), any());
verify(view, never()).disableServerTemplates();
initViewWithValues(CONTAINER1, CONTAINER1, context.isStartContainer(), null);
popup.onOk();
verify(view).clearValidations();
verify(view).invalidateContainerServerTemplate(any());
verify(view, never()).hide();
verify(callback, never()).execute();
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class DeploymentPopupTest method testMultipleForcedTemplate.
@Test
public void testMultipleForcedTemplate() {
context = new BuildExecutionContext(CONTAINER3, CONTAINER3, null);
context.setServerTemplate(template1);
DefaultDeploymentPopupDriver driver = new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.MULTIPLE_SERVER_FORCED, () -> templates, callback, cancelCallback);
popup.show(driver);
verify(view).initContainerId(eq(CONTAINER3), eq(false));
verify(view).initContainerAlias(eq(CONTAINER3), eq(false));
verify(view).initStartContainer(eq(true), eq(false));
verify(view).initServerTemplates(any(), any());
verify(view, never()).disableServerTemplates();
initViewWithValues(context.getContainerId(), context.getContainerAlias(), context.isStartContainer(), template1.getId());
popup.onOk();
verify(view).clearValidations();
verify(view).hide();
verify(callback).execute();
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testDefaultBuild.
@Test
public void testDefaultBuild() {
buildExecutor.triggerBuild();
verify(buildExecutionManager).execute(eq(BuildType.BUILD), contextCaptor.capture());
BuildExecutionContext context = contextCaptor.getValue();
Assertions.assertThat(context).returns(buildExecutor.defaultContainerId(), BuildExecutionContext::getContainerId).returns(buildExecutor.defaultContainerAlias(), BuildExecutionContext::getContainerAlias).returns(module, BuildExecutionContext::getModule);
}
Aggregations