summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@est.tech>2020-04-17 10:25:23 +0100
committera.sreekumar <ajith.sreekumar@est.tech>2020-04-17 10:25:37 +0100
commitf6690ccc2786278659bb1f85b89a219e5018cb9a (patch)
treefaf239d3bfd4f6006c1e563f974190f5cbc72474
parentbed21af59885a954e3facf7226c4678f4b69b153 (diff)
Updating pdp-simulator as per recent changes to send PdpGroup in status
Change-Id: Ic2ad6bd7f65633eef73d6432f244be77d7c760f9 Issue-ID: POLICY-2499 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
-rw-r--r--models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java2
-rw-r--r--models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpStatusParameters.java5
-rw-r--r--models-sim/policy-models-sim-pdp/src/main/resources/config/OnapPfConfig.json3
-rw-r--r--models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/CommonTestData.java4
-rw-r--r--models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/TestPdpStatusParameters.java1
-rw-r--r--models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters.json3
-rw-r--r--models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters_sim.json3
-rw-r--r--models-sim/policy-models-sim-pdp/src/test/resources/TestConfigParameters.json3
8 files changed, 15 insertions, 9 deletions
diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java
index de0edef0c..d77ece054 100644
--- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java
+++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/handler/PdpMessageHandler.java
@@ -23,7 +23,6 @@ package org.onap.policy.models.sim.pdp.handler;
import java.util.ArrayList;
import java.util.List;
-
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpResponseDetails;
import org.onap.policy.models.pdp.concepts.PdpStatus;
@@ -53,6 +52,7 @@ public class PdpMessageHandler {
public PdpStatus createPdpStatusFromParameters(final String instanceId,
final PdpStatusParameters pdpStatusParameters) {
final PdpStatus pdpStatus = new PdpStatus();
+ pdpStatus.setPdpGroup(pdpStatusParameters.getPdpGroup());
pdpStatus.setPdpType(pdpStatusParameters.getPdpType());
pdpStatus.setState(PdpState.PASSIVE);
pdpStatus.setHealthy(PdpHealthStatus.HEALTHY);
diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpStatusParameters.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpStatusParameters.java
index e59ec52b7..c8160373c 100644
--- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpStatusParameters.java
+++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpStatusParameters.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,9 +21,7 @@
package org.onap.policy.models.sim.pdp.parameters;
import java.util.List;
-
import lombok.Getter;
-
import org.onap.policy.common.parameters.ParameterGroupImpl;
import org.onap.policy.common.parameters.annotations.Min;
import org.onap.policy.common.parameters.annotations.NotBlank;
@@ -45,6 +43,7 @@ public class PdpStatusParameters extends ParameterGroupImpl {
private String pdpType;
private String description;
private List<ToscaPolicyTypeIdentifierParameters> supportedPolicyTypes;
+ private String pdpGroup;
public PdpStatusParameters() {
super(PdpStatusParameters.class.getSimpleName());
diff --git a/models-sim/policy-models-sim-pdp/src/main/resources/config/OnapPfConfig.json b/models-sim/policy-models-sim-pdp/src/main/resources/config/OnapPfConfig.json
index cb8c4dd0f..4b05fd985 100644
--- a/models-sim/policy-models-sim-pdp/src/main/resources/config/OnapPfConfig.json
+++ b/models-sim/policy-models-sim-pdp/src/main/resources/config/OnapPfConfig.json
@@ -1,6 +1,7 @@
{
"name":"OnapPfParameterGroup",
- "pdpStatusParameters":{
+ "pdpStatusParameters": {
+ "pdpGroup": "defaultGroup",
"timeIntervalMs": 120000,
"pdpType":"apex",
"description":"Pdp Heartbeat",
diff --git a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/CommonTestData.java b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/CommonTestData.java
index 123aa4444..7c740c4b2 100644
--- a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/CommonTestData.java
+++ b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/CommonTestData.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019-2020 Nordix Foundation.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -43,6 +43,7 @@ public class CommonTestData {
public static final String PDP_NAME = "apex-pdp";
public static final String VERSION = "0.0.1";
public static final String PDP_TYPE = "apex";
+ public static final String PDP_GROUP = "defaultGroup";
public static final String DESCRIPTION = "Pdp status for HealthCheck";
public static final String POLICY_NAME = "onap.controllloop.operational.apex.BBS";
public static final String POLICY_VERSION = "0.0.1";
@@ -150,6 +151,7 @@ public class CommonTestData {
map.put("pdpName", PDP_NAME);
map.put("version", VERSION);
map.put("pdpType", PDP_TYPE);
+ map.put("pdpGroup", PDP_GROUP);
map.put("description", DESCRIPTION);
map.put("supportedPolicyTypes", SUPPORTED_POLICY_TYPES);
}
diff --git a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/TestPdpStatusParameters.java b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/TestPdpStatusParameters.java
index 49ec29bb7..1798bb2f5 100644
--- a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/TestPdpStatusParameters.java
+++ b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/parameters/TestPdpStatusParameters.java
@@ -46,6 +46,7 @@ public class TestPdpStatusParameters {
assertEquals(CommonTestData.PDP_TYPE, pdpStatusParameters.getPdpType());
assertEquals(CommonTestData.DESCRIPTION, pdpStatusParameters.getDescription());
assertEquals(CommonTestData.SUPPORTED_POLICY_TYPES, pdpStatusParameters.getSupportedPolicyTypes());
+ assertEquals(CommonTestData.PDP_GROUP, pdpStatusParameters.getPdpGroup());
}
@Test
diff --git a/models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters.json b/models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters.json
index 61028a99e..c30b91b4a 100644
--- a/models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters.json
+++ b/models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters.json
@@ -1,6 +1,7 @@
{
"name":"PdpSimulatorParameterGroup",
- "pdpStatusParameters":{
+ "pdpStatusParameters": {
+ "pdpGroup": "defaultGroup",
"timeIntervalMs": 120000,
"pdpType":"apex",
"description":"Pdp Heartbeat",
diff --git a/models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters_sim.json b/models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters_sim.json
index 40320d8a6..689486728 100644
--- a/models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters_sim.json
+++ b/models-sim/policy-models-sim-pdp/src/test/resources/PdpSimulatorConfigParameters_sim.json
@@ -1,6 +1,7 @@
{
"name":"PdpSimulatorParameterGroup",
- "pdpStatusParameters":{
+ "pdpStatusParameters": {
+ "pdpGroup": "defaultGroup",
"timeIntervalMs": 120000,
"pdpType":"apex",
"description":"Pdp Heartbeat",
diff --git a/models-sim/policy-models-sim-pdp/src/test/resources/TestConfigParameters.json b/models-sim/policy-models-sim-pdp/src/test/resources/TestConfigParameters.json
index e77cb5a87..7ddc45cf6 100644
--- a/models-sim/policy-models-sim-pdp/src/test/resources/TestConfigParameters.json
+++ b/models-sim/policy-models-sim-pdp/src/test/resources/TestConfigParameters.json
@@ -1,6 +1,7 @@
{
"name":"PdpSimulatorParameterGroup",
- "pdpStatusParameters":{
+ "pdpStatusParameters": {
+ "pdpGroup": "defaultGroup",
"timeIntervalMs": 120000,
"pdpType":"apex",
"description":"Pdp heartbeat",