From dd48a8a5083e3a65c8b47ce45ce7517afc47c1ff Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Fri, 26 Jul 2019 20:24:59 +0000 Subject: Improve code coverage in sli adaptors increase code coverage in message router in sli adaptors Issue-ID: CCSDK-1548 Signed-off-by: Smokowski, Kevin (ks6305) Change-Id: I64f0e025a759b219ce4c7e017b500952d1c7f30b --- .../publisher/client/impl/ClientImplTest.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 message-router/publisher/sample.client/src/test/java/org/onap/ccsdk/sli/adaptors/messagerouter/publisher/client/impl/ClientImplTest.java (limited to 'message-router/publisher/sample.client/src/test/java') diff --git a/message-router/publisher/sample.client/src/test/java/org/onap/ccsdk/sli/adaptors/messagerouter/publisher/client/impl/ClientImplTest.java b/message-router/publisher/sample.client/src/test/java/org/onap/ccsdk/sli/adaptors/messagerouter/publisher/client/impl/ClientImplTest.java new file mode 100644 index 000000000..82a1566c3 --- /dev/null +++ b/message-router/publisher/sample.client/src/test/java/org/onap/ccsdk/sli/adaptors/messagerouter/publisher/client/impl/ClientImplTest.java @@ -0,0 +1,29 @@ +package org.onap.ccsdk.sli.adaptors.messagerouter.publisher.client.impl; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.onap.ccsdk.sli.adaptors.messagerouter.publisher.api.PublisherApi; + +public class ClientImplTest { + + @Test + public void testSetTopic() { + ClientImpl impl = new ClientImpl(); + String myTopic = "stock updates"; + impl.setTopic(myTopic); + + PublisherApi publisherImpl = new PublisherApi() { + + @Override + public Boolean publish(String topic, String body) { + assertEquals(myTopic,topic); + return true; + } + + }; + impl.setPublisher(publisherImpl); + impl.init(); + } + +} -- cgit 1.2.3-korg