use of org.kie.server.controller.api.model.spec.ServerTemplateList in project kie-wb-common by kiegroup.
the class AbstractControllerIT method testSpecManagementService.
@Test
@OperateOnDeployment("workbench")
public void testSpecManagementService() throws Exception {
final ServerTemplateList serverTemplateList = specManagementService.listServerTemplates();
assertServerTemplateList(serverTemplateList);
}
use of org.kie.server.controller.api.model.spec.ServerTemplateList in project kie-wb-common by kiegroup.
the class EmbeddedControllerIT method testEmbeddedEndpoints.
protected void testEmbeddedEndpoints(final KieServerControllerClient client) {
try {
final ServerTemplateList serverTemplateList = client.listServerTemplates();
assertServerTemplateList(serverTemplateList);
} finally {
if (client != null) {
try {
client.close();
} catch (IOException ex) {
LOGGER.warn("Error trying to close client connection: {}", ex.getMessage(), ex);
}
}
}
}
use of org.kie.server.controller.api.model.spec.ServerTemplateList 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.ServerTemplateList 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);
}
use of org.kie.server.controller.api.model.spec.ServerTemplateList in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testBuildAndDeployCommandSingleServerTemplate.
@Test
public void testBuildAndDeployCommandSingleServerTemplate() {
final ServerTemplate serverTemplate = new ServerTemplate("id", "name");
when(specManagementServiceMock.listServerTemplates()).thenReturn(new ServerTemplateList(Collections.singletonList(serverTemplate)));
buildExecutor.triggerBuildAndDeploy();
ArgumentCaptor<ContainerSpec> containerSpecArgumentCaptor = ArgumentCaptor.forClass(ContainerSpec.class);
verify(specManagementServiceMock).saveContainerSpec(eq(serverTemplate.getId()), containerSpecArgumentCaptor.capture());
final ContainerSpec containerSpec = containerSpecArgumentCaptor.getValue();
assertEquals(module.getPom().getGav().getArtifactId(), containerSpec.getContainerName());
verifyNotification(ProjectEditorResources.CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS);
verifyNotification(ProjectEditorResources.CONSTANTS.DeploySuccessful(), NotificationEvent.NotificationType.SUCCESS);
verify(notificationEvent, times(2)).fire(any(NotificationEvent.class));
verifyBusyShowHideAnyString(1, 1);
}
Aggregations