diff options
author | Yan Yang <yangyanyj@chinamobile.com> | 2019-05-03 03:26:24 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-05-03 03:26:24 +0000 |
commit | a5336234db7c92232371b3bcc28817baaf4144f0 (patch) | |
tree | 6a56dffb31f60f2ab3220785c458f89294964de4 /components/datalake-handler/feeder/src/test/java/org/onap | |
parent | 3d1fcfc96a550893657ec4df15a1ce852e7feda4 (diff) | |
parent | 7978e16b4f73845ae2c897d27074227f22af7acc (diff) |
Merge "Handle duplicate id"
Diffstat (limited to 'components/datalake-handler/feeder/src/test/java/org/onap')
2 files changed, 13 insertions, 4 deletions
diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicTest.java index 74f0884f..4397e914 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/domain/TopicTest.java @@ -68,6 +68,7 @@ public class TopicTest { assertTrue(testTopic.equals(new Topic("test"))); assertEquals(testTopic.hashCode(), (new Topic("test")).hashCode()); + assertEquals(testTopic.toString(), "test"); defaultTopic.setDbs(new HashSet<>()); defaultTopic.getDbs().add(new Db("Elasticsearch")); diff --git a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java index c65e920e..dc9feedc 100644 --- a/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java +++ b/components/datalake-handler/feeder/src/test/java/org/onap/datalake/feeder/dto/TopicConfigTest.java @@ -28,6 +28,7 @@ import java.util.HashSet; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -79,13 +80,20 @@ public class TopicConfigTest { public void testIs() { Topic testTopic = new Topic("test"); - assertTrue(testTopic.equals(new Topic("test"))); - assertEquals(testTopic.hashCode(), (new Topic("test")).hashCode()); - + TopicConfig testTopicConfig = testTopic.getTopicConfig(); + testTopicConfig.setSinkdbs(null); + assertFalse(testTopicConfig.supportElasticsearch()); + assertNull(testTopicConfig.getDataFormat2()); + testTopic.setDbs(new HashSet<>()); testTopic.getDbs().add(new Db("Elasticsearch")); - TopicConfig testTopicConfig = testTopic.getTopicConfig(); + testTopicConfig = testTopic.getTopicConfig(); + + assertEquals(testTopicConfig, new Topic("test").getTopicConfig()); + assertNotEquals(testTopicConfig, testTopic); + assertNotEquals(testTopicConfig, null); + assertEquals(testTopicConfig.hashCode(), (new Topic("test").getTopicConfig()).hashCode()); assertTrue(testTopicConfig.supportElasticsearch()); assertFalse(testTopicConfig.supportCouchbase()); |