From: Guobiao Mo Date: Sun, 7 Jul 2019 17:06:13 +0000 (-0700) Subject: Unit test X-Git-Tag: 2.0.0~88 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=7a094862a6a679b022bf777d3f15e32a048ba4d8;p=dcaegen2%2Fservices.git Unit test Issue-ID: DCAEGEN2-1468 Change-Id: Ib86b58ce77d4e03e695140729d8abb280594842c Signed-off-by: Guobiao Mo --- 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(); }