Unit test 95/90995/1
authorGuobiao Mo <guobiaomo@chinamobile.com>
Sun, 7 Jul 2019 17:06:13 +0000 (10:06 -0700)
committerGuobiao Mo <guobiaomo@chinamobile.com>
Sun, 7 Jul 2019 17:06:13 +0000 (10:06 -0700)
Issue-ID: DCAEGEN2-1468

Change-Id: Ib86b58ce77d4e03e695140729d8abb280594842c
Signed-off-by: Guobiao Mo <guobiaomo@chinamobile.com>
components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/KafkaTest.java [new file with mode: 0644]
components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicNameTest.java
components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/db/CouchbaseServiceTest.java

diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/KafkaTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/KafkaTest.java
new file mode 100644 (file)
index 0000000..8153523
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : DataLake
+ * ================================================================================
+ * 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.domain;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
+import org.junit.Test;
+import org.onap.datalake.feeder.dto.KafkaConfig;
+import org.onap.datalake.feeder.util.TestUtil;
+
+/**
+ * Test TopicName
+ *
+ * @author Guobiao Mo
+ */
+
+public class KafkaTest {
+
+
+       @Test
+       public void test() {
+               Kafka kafka = TestUtil.newKafka("test");
+               kafka.setName(null); 
+               kafka.setTopics(null);
+               kafka.getTopics();
+               kafka.hashCode();
+
+               KafkaConfig kc = kafka.getKafkaConfig(); 
+               
+               assertEquals(kafka, kafka);
+               assertNotEquals(kafka, null);
+               assertNotEquals(kafka, "test");
+
+       }
+
+}
index d031b31..3b9579b 100644 (file)
@@ -35,7 +35,7 @@ public class TopicNameTest {
 
        @Test
        public void test() {
-               TopicName topicName = new TopicName("tes");
+               TopicName topicName = new TopicName("test");
                topicName.setDesigns(null);
                topicName.getDesigns();
                topicName.setTopics(null);
index e43d30d..27bdadd 100755 (executable)
@@ -150,8 +150,6 @@ public class CouchbaseServiceTest {
                couchbaseService.bucket = bucket;
                ApplicationConfiguration appConfig = new ApplicationConfiguration();
                couchbaseService.config = appConfig;
-
-               couchbaseService.init();
                couchbaseService.cleanUp();
        }