Updated the testcases 95/48395/1
authorsunil unnava <su622b@att.com>
Mon, 21 May 2018 23:31:05 +0000 (19:31 -0400)
committersunil unnava <su622b@att.com>
Mon, 21 May 2018 23:31:19 +0000 (19:31 -0400)
Issue-ID: DMAAP-500
Change-Id: I7f3f41dc20371eb9a12799e6d3159e38edb64549
Signed-off-by: sunil unnava <su622b@att.com>
src/test/java/com/att/nsa/dmaapMMAgent/TestMirrorMakerAgent.java

index 1dcd6c8..ddefa5c 100644 (file)
@@ -50,7 +50,7 @@ public class TestMirrorMakerAgent {
        ArrayList<MirrorMaker> listsMirrorMaker = new ArrayList<MirrorMaker>();
        Gson g = new Gson();
        @InjectMocks
        ArrayList<MirrorMaker> listsMirrorMaker = new ArrayList<MirrorMaker>();
        Gson g = new Gson();
        @InjectMocks
-       private MirrorMakerAgent agent = spy(new MirrorMakerAgent());
+       private MirrorMakerAgent agent;
        @Mock
        private TopicUtil topicUtil;
 
        @Mock
        private TopicUtil topicUtil;
 
@@ -73,12 +73,14 @@ public class TestMirrorMakerAgent {
 
        @Test
        public void testReadAgentTopics() {
 
        @Test
        public void testReadAgentTopics() {
+               
                agent.exitLoop = true;
                agent.readAgentTopic();
        }
 
        @Test
        public void testReadCreateMirrorMaker() {
                agent.exitLoop = true;
                agent.readAgentTopic();
        }
 
        @Test
        public void testReadCreateMirrorMaker() {
+               
                String topicMessage = "{ messageID:\"test\", createMirrorMaker: {   name:\"test\",   consumer:\"test\",  producer:\"test\"}}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                agent.readAgent(object, topicMessage);
                String topicMessage = "{ messageID:\"test\", createMirrorMaker: {   name:\"test\",   consumer:\"test\",  producer:\"test\"}}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                agent.readAgent(object, topicMessage);
@@ -87,6 +89,7 @@ public class TestMirrorMakerAgent {
 
        @Test
        public void testReadUpdateMirrorMaker() {
 
        @Test
        public void testReadUpdateMirrorMaker() {
+               
                String topicMessage = "{ messageID:\"test\", updateMirrorMaker: {   name:\"test\",   consumer:\"test\",  producer:\"test\"}}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                testReadCreateMirrorMaker();
                String topicMessage = "{ messageID:\"test\", updateMirrorMaker: {   name:\"test\",   consumer:\"test\",  producer:\"test\"}}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                testReadCreateMirrorMaker();
@@ -96,6 +99,7 @@ public class TestMirrorMakerAgent {
 
        @Test
        public void testReadDeleteMirrorMaker() {
 
        @Test
        public void testReadDeleteMirrorMaker() {
+               
                String topicMessage = "{ messageID:\"test\", deleteMirrorMaker: {   name:\"test\",   consumer:\"test\",  producer:\"test\",  whitelist:\"test\",status:\"test\" }}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                testReadCreateMirrorMaker();
                String topicMessage = "{ messageID:\"test\", deleteMirrorMaker: {   name:\"test\",   consumer:\"test\",  producer:\"test\",  whitelist:\"test\",status:\"test\" }}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                testReadCreateMirrorMaker();
@@ -105,6 +109,7 @@ public class TestMirrorMakerAgent {
 
        @Test
        public void testReadListMirrorMaker() {
 
        @Test
        public void testReadListMirrorMaker() {
+               
                String topicMessage = "{ messageID:\"test\", listAllMirrorMaker: {   name:\"test\",   consumer:\"test\",  producer:\"test\",  whitelist:\"test\",status:\"test\" }}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                testReadCreateMirrorMaker();
                String topicMessage = "{ messageID:\"test\", listAllMirrorMaker: {   name:\"test\",   consumer:\"test\",  producer:\"test\",  whitelist:\"test\",status:\"test\" }}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                testReadCreateMirrorMaker();
@@ -114,6 +119,7 @@ public class TestMirrorMakerAgent {
 
        @Test
        public void testReadWhitelistMirrorMaker() {
 
        @Test
        public void testReadWhitelistMirrorMaker() {
+               
                String topicMessage = "{ messageID:\"test\", updateWhiteList: {   name:\"test\",   consumer:\"test\",  producer:\"test\",  whitelist:\"test\",status:\"test\" }}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                testReadCreateMirrorMaker();
                String topicMessage = "{ messageID:\"test\", updateWhiteList: {   name:\"test\",   consumer:\"test\",  producer:\"test\",  whitelist:\"test\",status:\"test\" }}";
                LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
                testReadCreateMirrorMaker();

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use