summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2020-04-03 17:44:19 +0200
committersebdet <sebastien.determe@intl.att.com>2020-04-03 18:11:29 +0200
commit3cbd2dc396a8789f2cfcaaef9c17795e59bec31a (patch)
tree3706a300c454b93e1bd826cfd7968ec613dcd403 /src
parentc0426bafb14ca8564ef2d0c64479b0acf005e315 (diff)
Fix pdp group info not there for legacy policy
The operational policy legacy name must be changed so that clamp can get the right pdp group and subgroup Issue-ID: CLAMP-817 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: Iaede77977b8f450c10bf7df73cf2b84a74ab122a
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/clamp/clds/config/LegacyOperationalPolicyController.java (renamed from src/main/java/org/onap/clamp/clds/config/LegacyOperationalPolicy.java)4
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java4
-rw-r--r--src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java4
3 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/org/onap/clamp/clds/config/LegacyOperationalPolicy.java b/src/main/java/org/onap/clamp/clds/config/LegacyOperationalPolicyController.java
index 7d4b5f8fe..69e94a35a 100644
--- a/src/main/java/org/onap/clamp/clds/config/LegacyOperationalPolicy.java
+++ b/src/main/java/org/onap/clamp/clds/config/LegacyOperationalPolicyController.java
@@ -32,12 +32,12 @@ import org.springframework.context.annotation.Profile;
@Configuration
@Profile("legacy-operational-policy")
-public class LegacyOperationalPolicy {
+public class LegacyOperationalPolicyController {
@Autowired
PolicyModelsService policyModelService;
- public static final String OPERATIONAL_POLICY_LEGACY = "onap.policies.operational.legacy";
+ public static final String OPERATIONAL_POLICY_LEGACY = "onap.policies.controlloop.Operational";
@PostConstruct
public void init() {
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
index 18ee84f77..1e721ce24 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
@@ -50,6 +50,7 @@ import javax.persistence.Transient;
import org.apache.commons.lang3.RandomStringUtils;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;
+import org.onap.clamp.clds.config.LegacyOperationalPolicyController;
import org.onap.clamp.clds.tosca.update.ToscaConverterWithDictionarySupport;
import org.onap.clamp.dao.model.jsontype.StringJsonUserType;
import org.onap.clamp.loop.Loop;
@@ -228,7 +229,8 @@ public class OperationalPolicy extends Policy implements Serializable {
}
public Boolean isLegacy() {
- return (this.getPolicyModel() != null) && this.getPolicyModel().getPolicyModelType().contains("legacy");
+ return (this.getPolicyModel() != null) && this.getPolicyModel().getPolicyModelType().contains(
+ LegacyOperationalPolicyController.OPERATIONAL_POLICY_LEGACY);
}
/**
diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
index d06695545..ac7b236e8 100644
--- a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
@@ -42,7 +42,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.onap.clamp.clds.Application;
-import org.onap.clamp.clds.config.LegacyOperationalPolicy;
+import org.onap.clamp.clds.config.LegacyOperationalPolicyController;
import org.onap.clamp.clds.exception.sdc.controller.BlueprintParserException;
import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException;
import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
@@ -164,7 +164,7 @@ public class CsarInstallerItCase {
@Transactional
public void testPolicyModelAddedAtStartup() {
assertThat(policyModelsRepository.findByPolicyModelType(
- LegacyOperationalPolicy.OPERATIONAL_POLICY_LEGACY).get(0)).isNotNull();
+ LegacyOperationalPolicyController.OPERATIONAL_POLICY_LEGACY).get(0)).isNotNull();
}
@Test