aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'asdctool/src/test')
-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;