Search in sources :

Example 1 with ProjectManifest

use of org.activiti.core.common.project.model.ProjectManifest in project Activiti by Activiti.

the class ApplicationUpgradeIT method should_enforcedAppVersionTakePriorityOverProjectManifestVersion.

@Test
public void should_enforcedAppVersionTakePriorityOverProjectManifestVersion() {
    ProjectManifest projectManifest = new ProjectManifest();
    projectManifest.setVersion("2");
    Deployment deployment1 = repositoryService.createDeployment().setEnforcedAppVersion(1).setProjectManifest(projectManifest).enableDuplicateFiltering().name("deploymentName").deploy();
    deploymentIds.add(deployment1.getId());
    assertThat(deployment1.getVersion()).isEqualTo(1);
    assertThat(deployment1.getProjectReleaseVersion()).isEqualTo("2");
    projectManifest.setVersion("17");
    Deployment deployment2 = repositoryService.createDeployment().setEnforcedAppVersion(5).setProjectManifest(projectManifest).enableDuplicateFiltering().name("deploymentName").deploy();
    deploymentIds.add(deployment2.getId());
    assertThat(deployment2.getVersion()).isEqualTo(5);
    assertThat(deployment2.getProjectReleaseVersion()).isEqualTo("17");
}
Also used : ProjectManifest(org.activiti.core.common.project.model.ProjectManifest) Deployment(org.activiti.engine.repository.Deployment) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with ProjectManifest

use of org.activiti.core.common.project.model.ProjectManifest in project Activiti by Activiti.

the class ApplicationUpgradeIT method should_updateDeploymentVersion_when_manifestIsPresent.

@Test
public void should_updateDeploymentVersion_when_manifestIsPresent() {
    ProjectManifest projectManifest = new ProjectManifest();
    projectManifest.setVersion("7");
    Deployment deployment1 = repositoryService.createDeployment().setProjectManifest(projectManifest).enableDuplicateFiltering().name("deploymentName").deploy();
    deploymentIds.add(deployment1.getId());
    assertThat(deployment1.getVersion()).isEqualTo(1);
    assertThat(deployment1.getProjectReleaseVersion()).isEqualTo("7");
    projectManifest.setVersion("17");
    Deployment deployment2 = repositoryService.createDeployment().setProjectManifest(projectManifest).enableDuplicateFiltering().name("deploymentName").deploy();
    deploymentIds.add(deployment2.getId());
    assertThat(deployment2.getProjectReleaseVersion()).isEqualTo("17");
    assertThat(deployment2.getVersion()).isEqualTo(2);
}
Also used : ProjectManifest(org.activiti.core.common.project.model.ProjectManifest) Deployment(org.activiti.engine.repository.Deployment) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 3 with ProjectManifest

use of org.activiti.core.common.project.model.ProjectManifest in project Activiti by Activiti.

the class ApplicationUpgradeContextServiceIT method should_retrieveManifest.

@Test
public void should_retrieveManifest() throws IOException {
    assertThat(applicationUpgradeContextService.hasProjectManifest()).isTrue();
    ProjectManifest projectModel = applicationUpgradeContextService.loadProjectManifest();
    assertThat(projectModel.getCreatedBy()).isEqualTo("superadminuser");
    assertThat(projectModel.getCreationDate()).isEqualTo("2019-08-16T15:58:46.056+0000");
    assertThat(projectModel.getDescription()).isEqualTo("");
    assertThat(projectModel.getId()).isEqualTo("c519a458-539f-4385-a937-2edfb4045eb9");
    assertThat(projectModel.getLastModifiedBy()).isEqualTo("qa-modeler-1");
    assertThat(projectModel.getLastModifiedDate()).isEqualTo("2019-08-16T16:03:41.941+0000");
    assertThat(projectModel.getName()).isEqualTo("projectA");
    assertThat(projectModel.getVersion()).isEqualTo("2");
}
Also used : ProjectManifest(org.activiti.core.common.project.model.ProjectManifest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 4 with ProjectManifest

use of org.activiti.core.common.project.model.ProjectManifest in project Activiti by Activiti.

the class ApplicationUpgradeIT method should_updateDeploymentVersion_when_onlyProjectManifestVersionIsSet.

@Test
public void should_updateDeploymentVersion_when_onlyProjectManifestVersionIsSet() {
    ProjectManifest projectManifest = new ProjectManifest();
    projectManifest.setVersion("2");
    Deployment deployment1 = repositoryService.createDeployment().setProjectManifest(projectManifest).enableDuplicateFiltering().name("deploymentName").deploy();
    deploymentIds.add(deployment1.getId());
    assertThat(deployment1.getVersion()).isEqualTo(1);
    assertThat(deployment1.getProjectReleaseVersion()).isEqualTo("2");
    projectManifest.setVersion("17");
    Deployment deployment2 = repositoryService.createDeployment().setProjectManifest(projectManifest).setEnforcedAppVersion(2).enableDuplicateFiltering().name("deploymentName").deploy();
    deploymentIds.add(deployment2.getId());
    assertThat(deployment2.getVersion()).isEqualTo(2);
    assertThat(deployment2.getProjectReleaseVersion()).isEqualTo("17");
}
Also used : ProjectManifest(org.activiti.core.common.project.model.ProjectManifest) Deployment(org.activiti.engine.repository.Deployment) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 5 with ProjectManifest

use of org.activiti.core.common.project.model.ProjectManifest in project Activiti by Activiti.

the class ApplicationUpgradeIT method should_getLatestProcessDefinitionByKey_when_multipleVersions.

@Test
public void should_getLatestProcessDefinitionByKey_when_multipleVersions() {
    ProjectManifest projectManifest = new ProjectManifest();
    projectManifest.setVersion("12");
    deploySingleTaskProcess(projectManifest);
    projectManifest.setVersion("34");
    deploySingleTaskProcess(projectManifest);
    securityUtil.logInAs("user");
    ProcessDefinition result = processRuntime.processDefinition(PROCESS_DEFINITION_KEY);
    assertThat(result).isNotNull();
    assertThat(result.getName()).isEqualTo(PROCESS_NAME);
    assertThat(result.getId()).contains(PROCESS_DEFINITION_KEY);
    assertThat(result.getAppVersion()).isEqualTo("2");
}
Also used : ProjectManifest(org.activiti.core.common.project.model.ProjectManifest) ProcessDefinition(org.activiti.api.process.model.ProcessDefinition) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

ProjectManifest (org.activiti.core.common.project.model.ProjectManifest)5 Test (org.junit.jupiter.api.Test)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 Deployment (org.activiti.engine.repository.Deployment)3 ProcessDefinition (org.activiti.api.process.model.ProcessDefinition)1