use of org.kie.server.controller.api.model.spec.ServerTemplate in project kie-wb-common by kiegroup.
the class ServerManagementPerspectiveTest method testOnNewContainer.
@Test
public void testOnNewContainer() {
final ServerTemplate template = mock(ServerTemplate.class);
perspective.onNewContainer(new AddNewContainer(template));
verify(newContainerWizard).clear();
verify(newContainerWizard).setServerTemplate(eq(template));
verify(newContainerWizard).start();
}
use of org.kie.server.controller.api.model.spec.ServerTemplate in project kie-wb-common by kiegroup.
the class ServerContainerEmptyPresenterTest method testTemplate.
@Test
public void testTemplate() {
final ServerTemplate template = new ServerTemplate("id", "name");
presenter.setTemplate(template);
verify(view).setTemplateName(template.getName());
}
use of org.kie.server.controller.api.model.spec.ServerTemplate in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testMakeConfigsWhenServerTemplateDoesNotHaveProcessCapability.
@Test
public void testMakeConfigsWhenServerTemplateDoesNotHaveProcessCapability() {
final ServerTemplate serverTemplate = mock(ServerTemplate.class);
final RuleConfig ruleConfig = mock(RuleConfig.class);
doReturn(ruleConfig).when(buildExecutor).makeRuleConfig();
final Map<Capability, ContainerConfig> configs = buildExecutor.makeConfigs(serverTemplate, new HashMap<>());
assertTrue(configs.keySet().contains(Capability.RULE));
assertTrue(configs.values().contains(ruleConfig));
assertEquals(1, configs.size());
}
use of org.kie.server.controller.api.model.spec.ServerTemplate in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testBuildAndDeployCommandSingleServerTemplateContainerExists.
@Test
public void testBuildAndDeployCommandSingleServerTemplateContainerExists() {
final String containerId = module.getPom().getGav().getArtifactId() + "_" + module.getPom().getGav().getVersion();
final String containerName = module.getPom().getGav().getArtifactId();
final ServerTemplate serverTemplate = new ServerTemplate("id", "name");
serverTemplate.addContainerSpec(new ContainerSpec(containerId, containerName, null, null, null, null));
when(specManagementServiceMock.listServerTemplates()).thenReturn(new ServerTemplateList(Collections.singletonList(serverTemplate)));
buildExecutor.triggerBuildAndDeploy();
verify(deploymentScreenPopupView).setValidateExistingContainerCallback(any(DeploymentScreenPopupViewImpl.ValidateExistingContainerCallback.class));
verify(deploymentScreenPopupView).setContainerId(containerId);
verify(deploymentScreenPopupView).setContainerAlias(containerName);
verify(deploymentScreenPopupView).setStartContainer(true);
verify(deploymentScreenPopupView).configure(any(com.google.gwt.user.client.Command.class));
verify(deploymentScreenPopupView).show();
verifyNoMoreInteractions(deploymentScreenPopupView);
}
use of org.kie.server.controller.api.model.spec.ServerTemplate in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testBuildAndDeployCommandMultipleServerTemplate.
@Test
public void testBuildAndDeployCommandMultipleServerTemplate() {
final String containerId = module.getPom().getGav().getArtifactId() + "_" + module.getPom().getGav().getVersion();
final String containerName = module.getPom().getGav().getArtifactId();
final ServerTemplate serverTemplate1 = new ServerTemplate("id1", "name1");
final ServerTemplate serverTemplate2 = new ServerTemplate("id2", "name2");
when(specManagementServiceMock.listServerTemplates()).thenReturn(new ServerTemplateList(Arrays.asList(serverTemplate1, serverTemplate2)));
buildExecutor.triggerBuildAndDeploy();
verify(deploymentScreenPopupView).setValidateExistingContainerCallback(any(DeploymentScreenPopupViewImpl.ValidateExistingContainerCallback.class));
verify(deploymentScreenPopupView).setContainerId(containerId);
verify(deploymentScreenPopupView).setContainerAlias(containerName);
verify(deploymentScreenPopupView).setStartContainer(true);
verify(deploymentScreenPopupView).addServerTemplates(eq(Sets.newHashSet("id1", "id2")));
verify(deploymentScreenPopupView).configure(any(com.google.gwt.user.client.Command.class));
verify(deploymentScreenPopupView).show();
verifyNoMoreInteractions(deploymentScreenPopupView);
}
Aggregations