summaryrefslogtreecommitdiffstats
path: root/components/datalake-handler/feeder/src
diff options
context:
space:
mode:
authorGuobiao Mo <guobiaomo@chinamobile.com>2019-07-07 10:06:13 -0700
committerGuobiao Mo <guobiaomo@chinamobile.com>2019-07-07 10:06:13 -0700
commit7a094862a6a679b022bf777d3f15e32a048ba4d8 (patch)
tree154a1a085703feb0e586bfd5bddc387226ff3e1c /components/datalake-handler/feeder/src
parentdb7b404ee53d8cb078e2f88046b0b0ac3d6f952d (diff)
Unit test
Issue-ID: DCAEGEN2-1468 Change-Id: Ib86b58ce77d4e03e695140729d8abb280594842c Signed-off-by: Guobiao Mo <guobiaomo@chinamobile.com>
Diffstat (limited to 'components/datalake-handler/feeder/src')
-rw-r--r--components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/KafkaTest.java54
-rw-r--r--components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicNameTest.java2
-rwxr-xr-xcomponents/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/db/CouchbaseServiceTest.java2
3 files changed, 55 insertions, 3 deletions
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
index 00000000..81535232
--- /dev/null
+++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/KafkaTest.java
@@ -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");
+
+ }
+
+}
diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicNameTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicNameTest.java
index d031b314..3b9579b9 100644
--- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicNameTest.java
+++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicNameTest.java
@@ -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);
diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/db/CouchbaseServiceTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/db/CouchbaseServiceTest.java
index e43d30d5..27bdadd6 100755
--- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/db/CouchbaseServiceTest.java
+++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/service/db/CouchbaseServiceTest.java
@@ -150,8 +150,6 @@ public class CouchbaseServiceTest {
couchbaseService.bucket = bucket;
ApplicationConfiguration appConfig = new ApplicationConfiguration();
couchbaseService.config = appConfig;
-
- couchbaseService.init();
couchbaseService.cleanUp();
}