Unit test code for datalake seed code 16/85316/1
authorRama-Huawei <rama.subba.reddy.s@huawei.com>
Mon, 15 Apr 2019 12:20:22 +0000 (17:50 +0530)
committerRama-Huawei <rama.subba.reddy.s@huawei.com>
Mon, 15 Apr 2019 12:20:22 +0000 (17:50 +0530)
Improved Util module code coverage

Issue-ID: DCAEGEN2-1309

Change-Id: Ia962c32a284f0b372f17a0e79da4ae1fe6a4b573
Signed-off-by: Rama-Huawei <rama.subba.reddy.s@huawei.com>
components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/util/UtilTest.java

index b0f5492..dc318ff 100644 (file)
@@ -1,43 +1,47 @@
 /*
-* ============LICENSE_START=======================================================
-* ONAP : DCAE
-* ================================================================================
-* Copyright 2019 China Mobile
-*=================================================================================
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-* ============LICENSE_END=========================================================
-*/
+ * ============LICENSE_START=======================================================
+ * ONAP : DCAE
+ * ================================================================================
+ * Copyright 2019 China Mobile
+ *=================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 
 package org.onap.datalake.feeder.util;
 
-import static org.junit.Assert.assertEquals;
-
 import org.junit.Test;
 
+import java.io.IOException;
+
+import static org.junit.Assert.assertEquals;
+
 /**
  * test utils
- * 
- * @author Guobiao Mo
  *
+ * @author Guobiao Mo
  */
 public class UtilTest {
-   
+
     @Test
     //only dot(.) in key got replaced
-       public void replaceDotInKey() {
-               String a = "\"u-y.t.y-t\":\"u.gfh\",\\\"jg.h\\\":\"j_9889\"";
-               String b = "\"u-y_t_y-t\":\"u.gfh\",\\\"jg_h\\\":\"j_9889\"";
+    public void replaceDotInKey() {
+        String a = "\"u-y.t.y-t\":\"u.gfh\",\\\"jg.h\\\":\"j_9889\"";
+        String b = "\"u-y_t_y-t\":\"u.gfh\",\\\"jg_h\\\":\"j_9889\"";
+
+        assertEquals(Util.replaceDotInKey(a), b);
 
-        assertEquals(Util.replaceDotInKey(a), b);   
-       }
+        String[] strArray2 = {"test1", "test2", "test3"};
+        Util.main(strArray2);
+    }
 }