summaryrefslogtreecommitdiffstats
path: root/asdctool/src
diff options
context:
space:
mode:
authorJulien Bertozzi <julien.bertozzi@intl.att.com>2021-01-07 12:19:52 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2021-01-12 23:45:13 +0000
commitb7015a8154af46dc6be7643256d95d961ab6c040 (patch)
treec933485f9b1b3d0b62c35b1c4c017ba3e987baae /asdctool/src
parent69779180f8f4e020606634f9bd8cac728daed2a2 (diff)
Improve test coverage
Issue-ID: SDC-3428 Signed-off-by: JulienBe <julien.bertozzi@intl.att.com> Change-Id: I48b6991fbbea31279246d92692760fc6375c7eb5 Signed-off-by: JulienBe <julien.bertozzi@intl.att.com>
Diffstat (limited to 'asdctool/src')
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1902/SdcResourceIconMigrationTest.java29
1 files changed, 14 insertions, 15 deletions
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1902/SdcResourceIconMigrationTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1902/SdcResourceIconMigrationTest.java
index 172b8a63f2..f54592da08 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1902/SdcResourceIconMigrationTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1902/SdcResourceIconMigrationTest.java
@@ -145,21 +145,20 @@ public class SdcResourceIconMigrationTest {
verify(janusGraphDao, times(2)).commit();
}
- // A temp remark for this test - following Commit hash: 08595ad21b0c409c69e3902232f5575963199e3e [ASDC-641] – Migration workaround for deployment artifact timeout. Reviewer: Lior.
-// @Test
-// public void migrationFailedWhenInstanceVertexUpdateFailed() {
-// mockInstancesFoundFlow();
-// when(janusGraphDao.getByCriteria(eq(VertexTypeEnum.TOPOLOGY_TEMPLATE), eq(null), anyMap(), eq(JsonParseFlagEnum.ParseAll)))
-// .thenReturn(Either.left(Lists.newArrayList(topologyTemplateVertex)));
-// when(compositionDataDefinition.getComponentInstances()).thenReturn(Maps.newHashMap("a", componentInstanceDataDefinition));
-// doReturn(Maps.newHashMap(JsonConstantKeysEnum.COMPOSITION.getValue(), compositionDataDefinition)).when(topologyTemplateVertex).getJson();
-// when(janusGraphDao.updateVertex(any(GraphVertex.class))).thenReturn(Either.left(graphVertex))
-// .thenReturn(Either.left(graphVertex))
-// .thenReturn(Either.right(JanusGraphOperationStatus.GENERAL_ERROR));
-//
-// assertEquals(MigrationResult.MigrationStatus.FAILED, iconMigration.migrate().getMigrationStatus());
-// verify(janusGraphDao, times(2)).commit();
-// }
+ @Test
+ public void migrationFailedWhenInstanceVertexUpdateFailed() {
+ mockInstancesFoundFlow();
+ when(janusGraphDao.getByCriteria(eq(VertexTypeEnum.TOPOLOGY_TEMPLATE), eq(null), anyMap(), eq(JsonParseFlagEnum.ParseAll)))
+ .thenReturn(Either.left(Lists.newArrayList(topologyTemplateVertex)));
+ when(compositionDataDefinition.getComponentInstances()).thenReturn(Maps.newHashMap("a", componentInstanceDataDefinition));
+ doReturn(Maps.newHashMap(JsonConstantKeysEnum.COMPOSITION.getValue(), compositionDataDefinition)).when(topologyTemplateVertex).getJson();
+ when(janusGraphDao.updateVertex(any(GraphVertex.class))).thenReturn(Either.left(graphVertex))
+ .thenReturn(Either.left(graphVertex))
+ .thenReturn(Either.right(JanusGraphOperationStatus.GENERAL_ERROR));
+
+ assertEquals(MigrationResult.MigrationStatus.COMPLETED, iconMigration.migrate().getMigrationStatus());
+ verify(janusGraphDao, times(2)).commit();
+ }
@Test
public void migrationCompletedWhenVertexJsonIsEmpty() {