summaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorRam Koya <rk541m@att.com>2018-05-21 23:40:45 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-21 23:40:45 +0000
commita213e69b87bfaec0cf23f136e84bd754f0203d99 (patch)
treeaf7ba00f1b3ddbc711191bbc0dfda0289f5ef23e /src/test/java
parent21cf6bed993d82fc2c27c742d5b4d274710f58d8 (diff)
parent09aefa740b806bd6b9fff9569b8a8cef7fe822a3 (diff)
Merge "Updated the testcases"
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/att/nsa/dmaapMMAgent/TestMirrorMakerAgent.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/java/com/att/nsa/dmaapMMAgent/TestMirrorMakerAgent.java b/src/test/java/com/att/nsa/dmaapMMAgent/TestMirrorMakerAgent.java
index 1dcd6c8..ddefa5c 100644
--- a/src/test/java/com/att/nsa/dmaapMMAgent/TestMirrorMakerAgent.java
+++ b/src/test/java/com/att/nsa/dmaapMMAgent/TestMirrorMakerAgent.java
@@ -50,7 +50,7 @@ public class TestMirrorMakerAgent {
ArrayList<MirrorMaker> listsMirrorMaker = new ArrayList<MirrorMaker>();
Gson g = new Gson();
@InjectMocks
- private MirrorMakerAgent agent = spy(new MirrorMakerAgent());
+ private MirrorMakerAgent agent;
@Mock
private TopicUtil topicUtil;
@@ -73,12 +73,14 @@ public class TestMirrorMakerAgent {
@Test
public void testReadAgentTopics() {
+
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);
@@ -87,6 +89,7 @@ public class TestMirrorMakerAgent {
@Test
public void testReadUpdateMirrorMaker() {
+
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() {
+
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() {
+
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() {
+
String topicMessage = "{ messageID:\"test\", updateWhiteList: { name:\"test\", consumer:\"test\", producer:\"test\", whitelist:\"test\",status:\"test\" }}";
LinkedTreeMap<?, ?> object = g.fromJson(topicMessage, LinkedTreeMap.class);
testReadCreateMirrorMaker();