diff options
5 files changed, 30 insertions, 10 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/wrapper/PackageHandler.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/wrapper/PackageHandler.java index b526f1b9..21db6f91 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/wrapper/PackageHandler.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/wrapper/PackageHandler.java @@ -91,7 +91,7 @@ public class PackageHandler extends BaseHandler<PackageData> { } @Override - public void check(PackageData packageData) throws MarketplaceResourceException { + public void check(PackageData packageData) { throw new UnsupportedOperationException(); } } diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/PackageResource.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/PackageResource.java index 1f6de0a0..9383fd0d 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/PackageResource.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/PackageResource.java @@ -37,7 +37,6 @@ import org.eclipse.jetty.http.HttpStatus; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.FormDataParam; import org.onap.vnfsdk.marketplace.db.connection.ConnectionUtil; -import org.onap.vnfsdk.marketplace.db.exception.MarketplaceResourceException; import org.onap.vnfsdk.marketplace.entity.response.CsarFileUriResponse; import org.onap.vnfsdk.marketplace.entity.response.PackageMeta; import org.onap.vnfsdk.marketplace.entity.response.UploadPackageResponse; diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/filemanage/FileManageTest.java b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/filemanage/FileManageTest.java index e04af4fa..75d221c7 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/filemanage/FileManageTest.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/filemanage/FileManageTest.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; +import autovalue.shaded.org.apache.commons.lang.ObjectUtils; import org.junit.Before; import org.junit.Test; import org.onap.vnfsdk.marketplace.filemanage.http.ToolUtil; diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/onboarding/hooks/functiontest/FunctionTestExceutorTest.java b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/onboarding/hooks/functiontest/FunctionTestExceutorTest.java index 086d0aed..dbcdfd9c 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/onboarding/hooks/functiontest/FunctionTestExceutorTest.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/onboarding/hooks/functiontest/FunctionTestExceutorTest.java @@ -50,7 +50,7 @@ public class FunctionTestExceutorTest { } - + @Test public void testExecFunctionTest2() { new MockUp<MsbDetailsHolder>() { @Mock 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 0452e32d..19bbe692 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 @@ -1208,22 +1208,34 @@ public class PackageResourceTest { public void testisTrimedEmptyString() { boolean res = ToolUtil.isTrimedEmptyString(null); assertEquals(res, true); - res = ToolUtil.isTrimedEmptyString(" "); + res = ToolUtil.isTrimedEmptyString(" huawei "); + assertEquals(res, false); + + } + @Test + public void testisTrimedEmptyArray() { + boolean res = ToolUtil.isTrimedEmptyArray(null); assertEquals(res, true); + String[] String1={"hua","wei"}; + res = ToolUtil.isTrimedEmptyArray(String1); + assertEquals(res, false); } @Test public void testisEmptyCollection() { - - boolean res = ToolUtil.isEmptyCollection(new ArrayList()); + ArrayList arr1 = new ArrayList(); + boolean res = ToolUtil.isEmptyCollection(arr1); assertEquals(res, true); + arr1.add("huawei"); + res = ToolUtil.isEmptyCollection(arr1); + assertEquals(res, false); } @Test public void testisYamlFile() { - File fileObj = new File("test.txt"); + File fileObj = new File("test.yaml"); boolean res = ToolUtil.isYamlFile(fileObj); - assertEquals(res, false); + assertEquals(res, true); } @Test @@ -1234,9 +1246,14 @@ public class PackageResourceTest { @Test public void testgetFormatFileSize() { - String res = ToolUtil.getFormatFileSize(10000000); + long fileSize = 1000*1000*1000*100; + String res = ToolUtil.getFormatFileSize(fileSize); + assertNotNull(res); + res = ToolUtil.getFormatFileSize(1000000000); assertNotNull(res); - res = ToolUtil.getFormatFileSize(10000); + res = ToolUtil.getFormatFileSize(200000); + assertNotNull(res); + res = ToolUtil.getFormatFileSize(100000); assertNotNull(res); res = ToolUtil.getFormatFileSize(100); assertNotNull(res); @@ -1257,6 +1274,8 @@ public class PackageResourceTest { assertNotNull(res); res = ToolUtil.processFileName("abc.zip"); assertNotNull(res); + res = ToolUtil.processFileName("abc"); + assertNotNull(res); } @Test @@ -1326,6 +1345,7 @@ public class PackageResourceTest { @Test public void testToolUtildeleteFile() { + boolean res = ToolUtil.deleteFile("src/test/resources", "TestOut.txt"); assertEquals(res, true); } |