X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Fservice%2FMR_ClientServiceTest.java;h=0456d10b46f741f43e7b60af2db82e5b0dc32bd9;hb=5eeb7b8e6f7c4bbe5da8d08a8145109e2f05329f;hp=470ca6cbef946b1684b54313bbb2ea40c1e2b9ad;hpb=503da874ce876dbe463bcc1a03f63ea0f48fe650;p=dmaap%2Fdbcapi.git diff --git a/src/test/java/org/onap/dmaap/dbcapi/service/MR_ClientServiceTest.java b/src/test/java/org/onap/dmaap/dbcapi/service/MR_ClientServiceTest.java index 470ca6c..0456d10 100644 --- a/src/test/java/org/onap/dmaap/dbcapi/service/MR_ClientServiceTest.java +++ b/src/test/java/org/onap/dmaap/dbcapi/service/MR_ClientServiceTest.java @@ -18,15 +18,22 @@ * ============LICENSE_END========================================================= */ package org.onap.dmaap.dbcapi.service; -import org.onap.dmaap.dbcapi.model.*; -import static org.junit.Assert.*; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; -import java.util.List; -import java.util.ArrayList; +import org.onap.dmaap.dbcapi.model.ApiError; +import org.onap.dmaap.dbcapi.model.DcaeLocation; +import org.onap.dmaap.dbcapi.model.MR_Client; +import org.onap.dmaap.dbcapi.model.MR_Cluster; +import org.onap.dmaap.dbcapi.model.Topic; +import org.onap.dmaap.dbcapi.testframework.DmaapObjectFactory; +import org.onap.dmaap.dbcapi.testframework.ReflectionHarness; public class MR_ClientServiceTest { @@ -86,11 +93,11 @@ public class MR_ClientServiceTest { public void test3() { Topic topic = factory.genSimpleTopic( "test3" ); ApiError err = new ApiError(); - Topic nTopic = ts.addTopic( topic, err ); + Topic nTopic = ts.addTopic( topic, err, false ); if ( nTopic != null ) { assertTrue( nTopic.getTopicName().equals( topic.getTopicName() )); } - String[] actions = { "pub", "view" }; + MR_Client c = factory.genPublisher( "edge", topic.getFqtn() ); c = cls.addMr_Client( c, topic, err ); @@ -101,27 +108,29 @@ public class MR_ClientServiceTest { public void test4() { List l = cls.getAllMr_Clients(); - ArrayList al = cls.getAllMrClients( "foo" ); + List al = cls.getAllMrClients( "foo" ); - ArrayList al2 = cls.getClientsByLocation( "central" ); + List al2 = cls.getClientsByLocation( "central" ); } @Test - public void test5() { + public void AddSubscriberToTopic() { Topic topic = factory.genSimpleTopic( "test5" ); ApiError err = new ApiError(); - Topic nTopic = ts.addTopic( topic, err ); + Topic nTopic = ts.addTopic( topic, err, false ); if ( nTopic != null ) { assertTrue( nTopic.getTopicName().equals( topic.getTopicName() )); } - MR_Client c = factory.genPublisher( "edge", topic.getFqtn() ); + MR_Client c = factory.genPublisher( "central", topic.getFqtn() ); c = cls.addMr_Client( c, topic, err ); - if ( c != null ) { - c = factory.genSubscriber( "edge", topic.getFqtn() ); - c = cls.updateMr_Client( c, err ); - assertTrue( err.getCode() == 200 ); - } - } + assertTrue( c != null ); + + c = factory.genSubscriber( "central", topic.getFqtn() ); + c = cls.addMr_Client( c, topic, err ); + assertTrue( err.getCode() == 200 ); + + } + }