From 3c3c833897dbfc0e85feaf36086a505f990ecb76 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Thu, 20 Jul 2017 01:29:49 +0300 Subject: [SDC] 1710 rebase + pom modifications Change-Id: I1f9c0a5201576c7a6b124f6a786db12c1a8cd7c0 Signed-off-by: Michael Lando --- .../core/execution/MigrationExecutorImplTest.java | 33 ++++++---------------- .../migration/service/SdcRepoServiceTest.java | 2 +- 2 files changed, 9 insertions(+), 26 deletions(-) (limited to 'asdctool/src/test/java/org') 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; -- cgit 1.2.3-korg