summaryrefslogtreecommitdiffstats
path: root/asdctool
diff options
context:
space:
mode:
authorxuegao <xue.gao@intl.att.com>2021-03-22 11:22:47 +0100
committerxuegao <xue.gao@intl.att.com>2021-03-24 08:25:00 +0100
commit134ca5667da901a703ecb0c78d96873712a9d0d3 (patch)
tree38738cddb2798a54d1f81c22d005b9ff1e0c79f0 /asdctool
parenteb57d1efc197968a4073b331b2dc8f40d8109847 (diff)
Improve test coverage
Add unit tests to improve test coverage. Issue-ID: SDC-3428 Change-Id: I9e00af2824366ae45d47d2dcecf322fd3e9a6fea Signed-off-by: xuegao <xue.gao@intl.att.com>
Diffstat (limited to 'asdctool')
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java43
1 files changed, 22 insertions, 21 deletions
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java
index 4ac5a9fdc6..75c974b2a9 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java
@@ -20,9 +20,11 @@
package org.openecomp.sdc.asdctool.migration.core.task;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult.MigrationStatus;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
public class MigrationResultTest {
@@ -32,27 +34,13 @@ public class MigrationResultTest {
@Test
- public void testGetMsg() {
- MigrationResult testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getMsg();
- }
-
-
- @Test
- public void testSetMsg() {
- MigrationResult testSubject;
- String msg = "";
-
- // default test
- testSubject = createTestSubject();
- testSubject.setMsg(msg);
+ public void testMsg() {
+ MigrationResult testSubject = createTestSubject();
+ assertNull(testSubject.getMsg());
+ testSubject.setMsg("msg");
+ assertEquals("msg", testSubject.getMsg());
}
-
@Test
public void testGetMigrationStatus() {
MigrationResult testSubject;
@@ -63,7 +51,6 @@ public class MigrationResultTest {
result = testSubject.getMigrationStatus();
}
-
@Test
public void testSetMigrationStatus() {
MigrationResult testSubject;
@@ -73,4 +60,18 @@ public class MigrationResultTest {
testSubject = createTestSubject();
testSubject.setMigrationStatus(migrationStatus);
}
+
+ @Test
+ public void testSuccess() {
+ MigrationResult testSubject = createTestSubject();
+ assertEquals(MigrationResult.MigrationStatus.COMPLETED, testSubject.success().getMigrationStatus());
+ }
+
+ @Test
+ public void testError() {
+ MigrationResult testSubject = createTestSubject();
+ MigrationResult result = testSubject.error("testErr");
+ assertEquals(MigrationStatus.FAILED, result.getMigrationStatus());
+ assertEquals("testErr", result.getMsg());
+ }
}