summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/test
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-14 16:41:35 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-14 16:41:35 +0800
commit8b2d0be73ab8dcbd573769ed89ad27ecd7c25f88 (patch)
treef1a9730298b9a5b22c0d8743957e00c0119c622a /rulemgt/src/test
parent049c1722681a7c0d564d625f2740cbc47c15a4be (diff)
Add DMaaP Configuration APIs for Testing
Change-Id: Iefc0f22da204f30fca8ef81effcd3497a347ebc0 Issue-ID: HOLMES-59 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'rulemgt/src/test')
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java1
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java10
2 files changed, 8 insertions, 3 deletions
diff --git a/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java
index bcf56ca..3939994 100644
--- a/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java
@@ -45,6 +45,7 @@ public class CorrelationRuleMapperTest {
expect(resultSet.getString("content")).andReturn("");
expect(resultSet.getString("vendor")).andReturn("");
expect(resultSet.getString("package")).andReturn("");
+ expect(resultSet.getString("ctrlloop")).andReturn("");
PowerMock.replay(resultSet);
mapper.map(0, resultSet, null);
PowerMock.verify(resultSet);
diff --git a/rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java
index 9837fc5..d448e40 100644
--- a/rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java
@@ -197,7 +197,8 @@ public class RuleMgtWrapperTest {
oldCorrelationRule.setContent("content");
oldCorrelationRule.setPackageName("testName");
oldCorrelationRule.setEnabled(1);
- RuleUpdateRequest ruleUpdateRequest = createRuleUpdateRequest("rule_1", "des2", "contetnt2", 1);
+ oldCorrelationRule.setClosedControlLoopName("cl-name");
+ RuleUpdateRequest ruleUpdateRequest = createRuleUpdateRequest("rule_1", "cl-name", "des2", "contetnt2", 1);
EasyMock.expect(correlationRuleDaoMock.queryRuleByRid("rule_1")).andReturn(oldCorrelationRule);
EasyMock.expect(engineWrapperMock.deleteRuleFromEngine("testName")).andReturn(true);
@@ -225,7 +226,8 @@ public class RuleMgtWrapperTest {
oldCorrelationRule.setContent("content");
oldCorrelationRule.setPackageName("testName");
oldCorrelationRule.setEnabled(1);
- RuleUpdateRequest ruleUpdateRequest = createRuleUpdateRequest("rule_1", "des1", "content", 1);
+ oldCorrelationRule.setClosedControlLoopName("cl-name");
+ RuleUpdateRequest ruleUpdateRequest = createRuleUpdateRequest("rule_1", "cl-name", "des1", "content", 1);
EasyMock.expect(correlationRuleDaoMock.queryRuleByRid("rule_1")).andReturn(oldCorrelationRule);
@@ -373,12 +375,14 @@ public class RuleMgtWrapperTest {
return rcr;
}
- private RuleUpdateRequest createRuleUpdateRequest(String ruleId, String description, String content, int enabled) {
+ private RuleUpdateRequest createRuleUpdateRequest(String ruleId, String clName, String description,
+ String content, int enabled) {
RuleUpdateRequest ruleUpdateRequest = new RuleUpdateRequest();
ruleUpdateRequest.setRuleId(ruleId);
ruleUpdateRequest.setDescription(description);
ruleUpdateRequest.setContent(content);
ruleUpdateRequest.setEnabled(enabled);
+ ruleUpdateRequest.setLoopControlName(clName);
return ruleUpdateRequest;
}