</dependency>
<!-- testing -->
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <version>${hamcrest-all.version}</version>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
--- /dev/null
+package org.openecomp.sdc.asdctool.migration.tasks.mig1806;
+
+import static org.junit.Assert.assertThat;
+import java.math.BigInteger;
+import org.hamcrest.core.Is;
+import org.hamcrest.core.IsNull;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.openecomp.sdc.asdctool.migration.core.DBVersion;
+import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
+import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
+import org.openecomp.sdc.be.model.operations.impl.UserAdminOperation;
+
+public class ForwardPathMigrationTest {
+
+ ForwardPathMigration forwardPathMigration = null;
+
+ @Mock
+ TitanDao titanDao;
+
+ @Mock
+ UserAdminOperation userAdminOperation;
+
+ @Mock
+ ToscaOperationFacade toscaOperationFacade;
+
+ @Before
+ public void setUp() throws Exception {
+ forwardPathMigration = new ForwardPathMigration(titanDao, userAdminOperation, toscaOperationFacade);
+ }
+
+ @Test
+ public void testDescription() {
+ assertThat(forwardPathMigration,IsNull.notNullValue());
+ assertThat("remove corrupted forwarding paths ", Is.is(forwardPathMigration.description()));
+ }
+
+ @Test
+ public void testGetVersion() {
+ DBVersion dbVersion = DBVersion.from(BigInteger.valueOf(Version.MAJOR.getValue()), BigInteger.valueOf(Version.MINOR.getValue()));
+ assertThat(dbVersion,Is.is(forwardPathMigration.getVersion()));
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testMigrate() {
+ assertThat(forwardPathMigration,IsNull.notNullValue());
+ forwardPathMigration.migrate();
+ }
+}
--- /dev/null
+package org.openecomp.sdc.asdctool.migration.tasks.mig1806;
+
+import static org.junit.Assert.assertThat;
+import java.math.BigInteger;
+import org.hamcrest.core.Is;
+import org.hamcrest.core.IsNull;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.asdctool.migration.core.DBVersion;
+import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic;
+import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
+import org.openecomp.sdc.be.model.operations.impl.UserAdminOperation;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ResourceLifecycleMigrationTest {
+
+ @Mock
+ private TitanDao titanDao;
+ @Mock
+ private LifecycleBusinessLogic lifecycleBusinessLogic;
+ @Mock
+ private UserAdminOperation userAdminOperation;
+
+ ResourceLifecycleMigration resourceLifecycleMigration = null;
+
+ @Before
+ public void setUp() throws Exception {
+ resourceLifecycleMigration =
+ new ResourceLifecycleMigration(titanDao, lifecycleBusinessLogic, userAdminOperation);
+ }
+
+ @Test
+ public void testDescription() {
+ assertThat(resourceLifecycleMigration,IsNull.notNullValue());
+ assertThat("change resource lifecycle state from testing to certified", Is.is(resourceLifecycleMigration.description()));
+ }
+
+ @Test
+ public void testGetVersion() {
+ DBVersion dbVersion = DBVersion.from(BigInteger.valueOf(Version.MAJOR.getValue()), BigInteger.valueOf(Version.MINOR.getValue()));
+ assertThat(dbVersion, Is.is(resourceLifecycleMigration.getVersion()));
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testMigrate() {
+ assertThat(resourceLifecycleMigration,IsNull.notNullValue());
+ resourceLifecycleMigration.migrate();
+ }
+}
--- /dev/null
+package org.openecomp.sdc.asdctool.migration.tasks.mig1806;
+
+import static org.junit.Assert.assertThat;
+import java.math.BigInteger;
+import org.hamcrest.core.Is;
+import org.hamcrest.core.IsNull;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.openecomp.sdc.asdctool.migration.core.DBVersion;
+import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
+
+@RunWith(MockitoJUnitRunner.class)
+public class SdcArchiveMigrationTest {
+ @Mock
+ private TitanDao titanDao;
+
+ SdcArchiveMigration sdcArchiveMigration = null;
+
+ @Before
+ public void setUp() throws Exception {
+ sdcArchiveMigration = new SdcArchiveMigration(titanDao);
+ }
+
+ @Test
+ public void testDescription() {
+ assertThat(sdcArchiveMigration,IsNull.notNullValue());
+ assertThat("add archive node for archiving/restoring components ", Is.is(sdcArchiveMigration.description()));
+ }
+
+ @Test
+ public void testGetVersion() {
+ DBVersion dbVersion = DBVersion.from(BigInteger.valueOf(Version.MAJOR.getValue()), BigInteger.valueOf(Version.MINOR.getValue()));
+ assertThat(dbVersion, Is.is(sdcArchiveMigration.getVersion()));
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testMigrate() {
+ assertThat(sdcArchiveMigration,IsNull.notNullValue());
+ sdcArchiveMigration.migrate();
+ }
+}
--- /dev/null
+package org.openecomp.sdc.asdctool.migration.tasks.mig1806;
+
+public enum Version {
+
+ MINOR(0), MAJOR(1806);
+
+ private final int value;
+
+ private Version(final int newValue) {
+ value = newValue;
+ }
+
+ public int getValue() {
+ return value;
+ }
+}
<extentreports.version>3.0.3</extentreports.version>
<cucumber.version>2.4.0</cucumber.version>
<bean-matchers.version>0.11</bean-matchers.version>
+ <hamcrest-all.version>1.3</hamcrest-all.version>
<!-- parser-->
<sdc-tosca-parser.version>1.3.5</sdc-tosca-parser.version>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
- <version>1.3</version>
+ <version>${hamcrest-all.version}</version>
<scope>test</scope>
</dependency>
<dependency>