aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/vnf-sdk-marketplace/src/test
diff options
context:
space:
mode:
authorHailong Zhang <zhanghailong22@huawei.com>2019-09-10 15:44:55 +0800
committerWeitao Gao <victor.gao@huawei.com>2019-10-14 06:51:59 +0000
commit51041bd80a870aad7bc3ad135e28221d5445b25d (patch)
tree3e993cd13342f66ebd1690d62c8fb3e970b8979d /vnfmarket-be/vnf-sdk-marketplace/src/test
parent7f232e125dbe030f0bf3c360865cba832b694404 (diff)
modify Sonar Issue
Issue-ID: VNFSDK-462 Signed-off-by: Hailong Zhang <zhanghailong22@huawei.com> Change-Id: I39216599b2a1f06297b89e86a84c84761a9437b4
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/test')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java
index 11cce8fb..0452e32d 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java
@@ -1146,6 +1146,9 @@ public class PackageResourceTest {
onBoardResultObj.setOperStatus(1);
boolean res = FileUtil.writeJsonDatatoFile(filePath, onBoardResultObj);
assertEquals(res, true);
+ String filePath1 = "src//test//resources";
+ res = FileUtil.writeJsonDatatoFile(filePath1, onBoardResultObj);
+ assertEquals(res, false);
}
@@ -1163,6 +1166,10 @@ public class PackageResourceTest {
String dirPath = "src//test//resources//TestDirectory";
boolean res = FileUtil.deleteFile(dirPath);
assertEquals(res, true);
+ String dirPath1 = "src//test//resources11";
+ res = FileUtil.deleteFile(dirPath1);
+ assertEquals(res, true);
+
}
@Test
@@ -1345,6 +1352,13 @@ public class PackageResourceTest {
}
@Test
+ public void testvalidateFile() {
+ File fileData= null;
+ boolean res = FileUtil.validateFile(fileData);
+ assertEquals(res, false);
+ }
+
+ @Test
public void testGetPkgSize() {
long pkgSize = PackageWrapperUtil.getPacakgeSize("src/test/resources/Test.txt");
assertNotNull(pkgSize);