aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/mso-infrastructure-bpmn/src/test
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2020-08-13 14:48:46 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-08-26 11:27:11 -0400
commit144ba4d5f307855741c0325589e9bd2c1e60163c (patch)
tree7930dc8bb283a803b534c98731821a7d83332412 /bpmn/mso-infrastructure-bpmn/src/test
parent8e29225e9f2e41754e55f90ddb7aca754570c1d7 (diff)
Remove auto process migration again
Remove auto process migration again Issue-ID: SO-3162 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I71d0222bc285f1099dc7c800a8fc6f27aa5f2d89
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn/src/test')
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationServiceTest.java124
1 files changed, 0 insertions, 124 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationServiceTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationServiceTest.java
deleted file mode 100644
index 36e828448d..0000000000
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/AutoProcessInstanceMigrationServiceTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.so.bpmn.common.workflow.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doReturn;
-import java.util.ArrayList;
-import java.util.List;
-import org.camunda.bpm.engine.ProcessEngine;
-import org.camunda.bpm.engine.RepositoryService;
-import org.camunda.bpm.engine.repository.ProcessDefinition;
-import org.camunda.bpm.engine.repository.ProcessDefinitionQuery;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Spy;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.springframework.core.env.Environment;
-
-@RunWith(MockitoJUnitRunner.class)
-public class AutoProcessInstanceMigrationServiceTest {
-
- @Mock
- private ProcessEngine processEngine;
-
- @Mock
- private ProcessDefinition outdated;
-
- @Mock
- private ProcessDefinition newDef;
-
- @Mock
- private ProcessDefinition key;
-
- @Mock
- private ProcessDefinition testKey;
-
- @Mock
- private ProcessDefinition suspendedDef;
-
- @Mock
- private RepositoryService repositoryService;
-
- @Mock
- private ProcessDefinitionQuery query;
-
- @Mock
- private ProcessDefinitionQuery keyQuery;
-
- @Mock
- private Environment env;
-
- @Spy
- @InjectMocks
- private AutoProcessInstanceMigrationService migrationService;
-
-
- @Test
- public void getOldProcessDefinitionsTest() {
- List<ProcessDefinition> expectedList = new ArrayList<>();
- expectedList.add(outdated);
-
- List<ProcessDefinition> defList = new ArrayList<>();
- defList.add(outdated);
- defList.add(newDef);
- defList.add(suspendedDef);
-
-
- doReturn(query).when(repositoryService).createProcessDefinitionQuery();
- doReturn(query).when(query).processDefinitionKey("test");
- doReturn(defList).when(query).list();
- doReturn(3).when(outdated).getVersion();
- doReturn(4).when(newDef).getVersion();
- doReturn(true).when(suspendedDef).isSuspended();
- List<ProcessDefinition> outdatedList = migrationService.getOldProcessDefinitions("test", 4);
-
- assertEquals(expectedList, outdatedList);
- }
-
- @Test
- public void getProcessDefinitionsTest() {
- List<ProcessDefinition> expected = new ArrayList<ProcessDefinition>();
- expected.add(testKey);
- expected.add(key);
-
- List<String> processDefinitionKeys = new ArrayList<String>();
- processDefinitionKeys.add("testKey");
- processDefinitionKeys.add("key");
-
- doReturn(processDefinitionKeys).when(env).getProperty("migration.processDefinitionKeys", List.class,
- new ArrayList<String>());
-
- doReturn(query).when(repositoryService).createProcessDefinitionQuery();
- doReturn(query).when(query).processDefinitionKey("testKey");
- doReturn(query).when(query).latestVersion();
- doReturn(testKey).when(query).singleResult();
-
- doReturn(keyQuery).when(query).processDefinitionKey("key");
- doReturn(keyQuery).when(keyQuery).latestVersion();
- doReturn(key).when(keyQuery).singleResult();
-
- List<ProcessDefinition> actualProcessDefinitions = migrationService.getProcessDefinitions();
-
- assertEquals(expected, actualProcessDefinitions);
- }
-}