diff options
Diffstat (limited to 'src/test/java/org/onap/dcae/common/publishing/DMaaPEventPublisherTest.java')
-rw-r--r-- | src/test/java/org/onap/dcae/common/publishing/DMaaPEventPublisherTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/org/onap/dcae/common/publishing/DMaaPEventPublisherTest.java b/src/test/java/org/onap/dcae/common/publishing/DMaaPEventPublisherTest.java index 4ea6482..2a138b2 100644 --- a/src/test/java/org/onap/dcae/common/publishing/DMaaPEventPublisherTest.java +++ b/src/test/java/org/onap/dcae/common/publishing/DMaaPEventPublisherTest.java @@ -72,4 +72,19 @@ public class DMaaPEventPublisherTest { dMaaPEventPublisher.sendEvent(jo,"test"); assertEquals("test", publisherCache.get()._1); } + + @Test + public void sendEventclosePublisherTest () throws Exception { + List<String> destination = List.of("test"); + PublisherConfig publisherConfig = new PublisherConfig(destination, "Test", "test", + "test123"); + DMaaPPublishersCache.CambriaPublishersCacheLoader publishersCache = + Mockito.mock(DMaaPPublishersCache.CambriaPublishersCacheLoader.class); + Map<String, PublisherConfig> publisherCache = HashMap.of("test", publisherConfig); + publisherCache.put("test", publisherConfig); + DMaaPEventPublisher dMaaPEventPublisher = new DMaaPEventPublisher(publisherCache); + JSONObject jo = null; + dMaaPEventPublisher.sendEvent(jo,"test"); + assertEquals("test", publisherCache.get()._1); + } } |