aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/test/java/org/onap
diff options
context:
space:
mode:
authorpriyanka.akhade <priyanka.akhade@huawei.com>2020-05-06 10:41:12 +0000
committerpriyanka.akhade <priyanka.akhade@huawei.com>2020-05-07 14:49:17 +0000
commit410f81f2be31540ac3f66e31726e0e6ed7fc4144 (patch)
tree0d0f8524909743d433fa911427169cf647f91837 /framework/src/test/java/org/onap
parent43daaf01499ac80d52187507e50f6ce7c5ce6026 (diff)
sonar vulnerability issue fix- Do something with the "boolean" value returned by "delete"; Enable server certificate validation on this SSL/TLS connection
Signed-off-by: priyanka.akhade <priyanka.akhade@huawei.com> Issue-ID: CLI-270 Change-Id: I1aa94f93bd71beeb0b6f6758be4b0687ea8536d2
Diffstat (limited to 'framework/src/test/java/org/onap')
-rw-r--r--framework/src/test/java/org/onap/cli/fw/store/OnapCommandExecutionStoreTest.java11
-rw-r--r--framework/src/test/java/org/onap/cli/fw/store/OnapCommandProfileStoreTest.java8
2 files changed, 18 insertions, 1 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/store/OnapCommandExecutionStoreTest.java b/framework/src/test/java/org/onap/cli/fw/store/OnapCommandExecutionStoreTest.java
index 639f6239..1907be20 100644
--- a/framework/src/test/java/org/onap/cli/fw/store/OnapCommandExecutionStoreTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/store/OnapCommandExecutionStoreTest.java
@@ -27,6 +27,7 @@ import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.*;
+import java.io.IOException;
public class OnapCommandExecutionStoreTest {
OnapCommandExecutionStore executionStore;
@@ -60,6 +61,16 @@ public class OnapCommandExecutionStoreTest {
executionStore.storeExectutionEnd(store, "abc", "abc", "abc", true);
assertTrue(new File(System.getProperty("user.dir") + File.separator + "abc").exists());
}
+ @Test
+ public void storeExectutionEndDeleteTest() throws IOException {
+ new File("target/in-progress").createNewFile();
+ OnapCommandExecutionStore.ExecutionStoreContext store = new OnapCommandExecutionStore.ExecutionStoreContext();
+ store.setExecutionId("abc");
+ store.setRequestId("abc");
+ store.setStorePath("target/");
+ executionStore.storeExectutionEnd(store, "abc", "abc", "abc", true);
+ assertFalse(new File("target" + File.separator + "in-progress").exists());
+ }
@Test
public void storeExectutionProgressTest() {
diff --git a/framework/src/test/java/org/onap/cli/fw/store/OnapCommandProfileStoreTest.java b/framework/src/test/java/org/onap/cli/fw/store/OnapCommandProfileStoreTest.java
index 3ffd45c0..1635b1b5 100644
--- a/framework/src/test/java/org/onap/cli/fw/store/OnapCommandProfileStoreTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/store/OnapCommandProfileStoreTest.java
@@ -22,13 +22,13 @@ import org.onap.cli.fw.cmd.execution.OnapCommandExceutionListCommandTest;
import org.onap.cli.fw.error.OnapCommandException;
import org.onap.cli.fw.error.OnapCommandPersistProfileFailed;
import org.onap.cli.fw.input.cache.OnapCommandParamEntity;
-import org.onap.cli.fw.utils.FileUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
+import java.io.IOException;
public class OnapCommandProfileStoreTest {
OnapCommandProfileStore onapCommandProfileStore;
@@ -62,6 +62,12 @@ public class OnapCommandProfileStoreTest {
onapCommandProfileStore.removeProfile("abc");
assertFalse(new File(System.getProperty("user.dir") + File.separator + "data/profiles/abc-profile.json").exists());
}
+ @Test
+ public void removeProfileDeleteTest() throws IOException {
+ new File(System.getProperty("user.dir") + File.separator + "data/profiles/abc-profile.json").createNewFile();
+ onapCommandProfileStore.removeProfile("abc");
+ assertFalse(new File(System.getProperty("user.dir") + File.separator + "data/profiles/abc-profile.json").exists());
+ }
@Test
public void addTest() {