summaryrefslogtreecommitdiffstats
path: root/asdctool/src/test/java/org
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-07-20 01:29:49 +0300
committerMichael Lando <ml636r@att.com>2017-07-20 01:30:06 +0300
commit3c3c833897dbfc0e85feaf36086a505f990ecb76 (patch)
tree8c308fbe7298aa65066ba0fc8a71e51d20d8e0de /asdctool/src/test/java/org
parent30db4407bab8cfea48e278d29e55b11c6c0a528c (diff)
[SDC] 1710 rebase + pom modifications
Change-Id: I1f9c0a5201576c7a6b124f6a786db12c1a8cd7c0 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'asdctool/src/test/java/org')
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImplTest.java33
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoServiceTest.java2
2 files changed, 9 insertions, 26 deletions
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImplTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImplTest.java
index 763d6c83d2..7d8cc5aa78 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImplTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutorImplTest.java
@@ -1,5 +1,6 @@
package org.openecomp.sdc.asdctool.migration.core.execution;
+import org.openecomp.sdc.asdctool.migration.DummyMigrationFactory;
import org.openecomp.sdc.asdctool.migration.core.DBVersion;
import org.openecomp.sdc.asdctool.migration.core.task.Migration;
import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult;
@@ -12,36 +13,18 @@ public class MigrationExecutorImplTest {
@Test
public void testExecuteMigration() throws Exception {
- MigrationExecutionResult execute = new MigrationExecutorImpl().execute(new DummyMigration());
-
+ MigrationExecutionResult execute = new MigrationExecutorImpl().execute(DummyMigrationFactory.SUCCESSFUL_MIGRATION);
+ assertMigrationTaskEntryByMigrationExecutionResult(execute, DummyMigrationFactory.SUCCESSFUL_MIGRATION);
}
- private void assertMigrationTaskEntryByMigrationExecutionResult(MigrationExecutionResult executionResult, Migration migration, MigrationResult result) {
- assertEquals(executionResult.getMsg(), result.getMsg());
- assertEquals(executionResult.getMigrationStatus().name(), result.getMigrationStatus());
+ private void assertMigrationTaskEntryByMigrationExecutionResult(MigrationExecutionResult executionResult, Migration migration) {
+ MigrationResult migrationResult = migration.migrate();
+ assertEquals(executionResult.getMsg(), migrationResult.getMsg());
+ assertEquals(executionResult.getMigrationStatus(), migrationResult.getMigrationStatus());
assertEquals(executionResult.getTaskName(), migration.getClass().getName());
assertEquals(executionResult.getVersion(), migration.getVersion());
+ assertEquals(executionResult.getDescription(), migration.description());
assertNotNull(executionResult.getExecutionTime());
}
- private class DummyMigration implements Migration {
-
- @Override
- public String description() {
- return null;
- }
-
- @Override
- public DBVersion getVersion() {
- return DBVersion.fromString("1710.22");
- }
-
- @Override
- public MigrationResult migrate() {
- MigrationResult migrationResult = new MigrationResult();
- migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.COMPLETED);
- migrationResult.setMsg("myMsg");
- return migrationResult;
- }
- }
}
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoServiceTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoServiceTest.java
index f8e9abe2c9..705f8d13e6 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoServiceTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/service/SdcRepoServiceTest.java
@@ -5,7 +5,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.internal.verification.Times;
import org.openecomp.sdc.asdctool.migration.core.DBVersion;
-import org.openecomp.sdc.be.dao.cassandra.MigrationTasksDao;
+import org.openecomp.sdc.asdctool.migration.dao.MigrationTasksDao;
import org.openecomp.sdc.be.resources.data.MigrationTaskEntry;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;