From d8dd1b86833125a348c274b9dd62b0ff2ca64f19 Mon Sep 17 00:00:00 2001 From: Shiwei Tian Date: Mon, 25 Sep 2017 10:29:29 +0800 Subject: [PATCH] modify pom and rule.enabled = 1 Issue-ID: HOLMES-63 Change-Id: Id136259af2951520f6b9d4781c32f0a64dc4e339 Signed-off-by: Shiwei Tian --- holmes-actions/pom.xml | 5 +++++ .../src/main/java/org/onap/holmes/common/dcae/entity/Rule.java | 1 + .../org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java | 2 +- .../src/main/java/org/onap/holmes/common/dmaap/Publisher.java | 3 ++- pom.xml | 6 ++++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/holmes-actions/pom.xml b/holmes-actions/pom.xml index 506d60a..a44a27f 100644 --- a/holmes-actions/pom.xml +++ b/holmes-actions/pom.xml @@ -94,6 +94,11 @@ powermock-api-easymock test + + org.powermock + powermock-api-mockito + test + org.powermock powermock-module-junit4-rule diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/entity/Rule.java b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/entity/Rule.java index 4ff1d05..207f224 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/entity/Rule.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/entity/Rule.java @@ -26,4 +26,5 @@ import lombok.Setter; public class Rule { private String name; private String contents; + private int enabled = 1; } diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java index 260b26a..e4899d3 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java @@ -102,7 +102,7 @@ public class DcaeConfigurationParser { Set> entries = jsonObject.entrySet(); for (Entry entry : entries) { if (entry.getKey().startsWith("holmes.default.rule")) { - ret.addDefaultRule(new Rule(entry.getKey(), (String) entry.getValue())); + ret.addDefaultRule(new Rule(entry.getKey(), (String) entry.getValue(), 1)); } } } diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java index eaeaf43..035ecaa 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.onap.holmes.common.dmaap; import com.fasterxml.jackson.core.JsonProcessingException; @@ -27,11 +26,13 @@ import javax.ws.rs.core.Response; import lombok.Getter; import lombok.Setter; import org.glassfish.jersey.client.ClientConfig; +import org.jvnet.hk2.annotations.Service; import org.onap.holmes.common.dmaap.entity.PolicyMsg; import org.onap.holmes.common.exception.CorrelationException; @Getter @Setter +@Service public class Publisher { private String topic; diff --git a/pom.xml b/pom.xml index 449c56d..378568d 100644 --- a/pom.xml +++ b/pom.xml @@ -139,6 +139,12 @@ 1.6.5 test + + org.powermock + powermock-api-mockito + 1.7.1 + test + org.powermock powermock-module-junit4-rule -- 2.16.6