aboutsummaryrefslogtreecommitdiffstats
path: root/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java')
-rw-r--r--common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java126
1 files changed, 126 insertions, 0 deletions
diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java
new file mode 100644
index 0000000000..f574accd13
--- /dev/null
+++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java
@@ -0,0 +1,126 @@
+package org.openecomp.sdc.common.util;
+
+import java.util.List;
+
+import javax.annotation.Generated;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+
+public class GeneralUtilityTest {
+
+ private GeneralUtility createTestSubject() {
+ return new GeneralUtility();
+ }
+
+
+ @Test
+ public void testGenerateTextFile() throws Exception {
+ String fileName = "";
+ String fileData = "";
+ boolean result;
+
+ // default test
+ result = GeneralUtility.generateTextFile(fileName, fileData);
+ }
+
+
+ @Test
+ public void testIsBase64Encoded() throws Exception {
+ byte[] data = new byte[] { ' ' };
+ boolean result;
+
+ // default test
+ result = GeneralUtility.isBase64Encoded(data);
+ }
+
+
+ @Test
+ public void testIsBase64Encoded_1() throws Exception {
+ String str = "";
+ boolean result;
+
+ // default test
+ result = GeneralUtility.isBase64Encoded(str);
+ }
+
+
+ @Test
+ public void testIsExceedingLimit() throws Exception {
+ String str = "";
+ int limit = 0;
+ boolean result;
+
+ // test 1
+ str = null;
+ result = GeneralUtility.isExceedingLimit(str, limit);
+ Assert.assertEquals(false, result);
+
+ // test 2
+ str = "";
+ result = GeneralUtility.isExceedingLimit(str, limit);
+ Assert.assertEquals(false, result);
+ }
+
+
+ @Test
+ public void testIsExceedingLimit_1() throws Exception {
+ List<String> strList = null;
+ int limit = 0;
+ int delimiterLength = 0;
+ boolean result;
+
+ // test 1
+ strList = null;
+ result = GeneralUtility.isExceedingLimit(strList, limit, delimiterLength);
+ Assert.assertEquals(false, result);
+ }
+
+
+ @Test
+ public void testGetFilenameExtension() throws Exception {
+ String fileName = "";
+ String result;
+
+ // test 1
+ fileName = null;
+ result = GeneralUtility.getFilenameExtension(fileName);
+ Assert.assertEquals("", result);
+
+ // test 2
+ fileName = "";
+ result = GeneralUtility.getFilenameExtension(fileName);
+ Assert.assertEquals("", result);
+ }
+
+
+ @Test
+ public void testCalculateMD5Base64EncodedByByteArray() throws Exception {
+ byte[] payload = new byte[] { ' ' };
+ String result;
+
+ // default test
+ result = GeneralUtility.calculateMD5Base64EncodedByByteArray(payload);
+ }
+
+
+ @Test
+ public void testCalculateMD5Base64EncodedByString() throws Exception {
+ String data = "";
+ String result;
+
+ // default test
+ result = GeneralUtility.calculateMD5Base64EncodedByString(data);
+ }
+
+
+ @Test
+ public void testIsEmptyString() throws Exception {
+ String str = "";
+ boolean result;
+
+ // default test
+ result = GeneralUtility.isEmptyString(str);
+ }
+} \ No newline at end of file