summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShiwei Tian <tian.shiwei@zte.com.cn>2017-09-25 10:29:29 +0800
committerShiwei Tian <tian.shiwei@zte.com.cn>2017-09-25 10:29:29 +0800
commitd8dd1b86833125a348c274b9dd62b0ff2ca64f19 (patch)
treee5423e9c5ab029ce808934f443b81ab25705b6ed
parent9d2cccba20f32fe54e4ccf1f433f68b5cee95bd5 (diff)
modify pom and rule.enabled = 1
Issue-ID: HOLMES-63 Change-Id: Id136259af2951520f6b9d4781c32f0a64dc4e339 Signed-off-by: Shiwei Tian <tian.shiwei@zte.com.cn>
-rw-r--r--holmes-actions/pom.xml5
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dcae/entity/Rule.java1
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dcae/utils/DcaeConfigurationParser.java2
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dmaap/Publisher.java3
-rw-r--r--pom.xml6
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
@@ -96,6 +96,11 @@
</dependency>
<dependency>
<groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4-rule</artifactId>
<scope>test</scope>
</dependency>
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<Entry<String, Object>> entries = jsonObject.entrySet();
for (Entry<String, Object> 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
@@ -141,6 +141,12 @@
</dependency>
<dependency>
<groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ <version>1.7.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4-rule</artifactId>
<version>1.6.5</version>
<scope>test</scope>