From 3c5d3e2894fb81d3897efb8164c64b3987a7a7c2 Mon Sep 17 00:00:00 2001 From: "waqas.ikram" Date: Mon, 12 Oct 2020 10:49:42 +0100 Subject: Updating code to read aai version from override Change-Id: Id813516286829a114a61d729cd584f88e8cec6ef Issue-ID: SO-3297 Signed-off-by: waqas.ikram --- .../etsisol003adapter/lcm/extclients/aai/AaiPropertiesImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'adapters/etsi-sol003-adapter/etsi-sol003-lcm') diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiPropertiesImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiPropertiesImpl.java index b3b22e239d..9e08cda354 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiPropertiesImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiPropertiesImpl.java @@ -32,13 +32,15 @@ public class AaiPropertiesImpl implements AAIProperties { private final String endpoint; private final String encryptedBasicAuth; private final String encrytptionKey; + private final String aaiVersion; public AaiPropertiesImpl() { - final ApplicationContext context = SpringContextHelper.getAppContext(); this.endpoint = context.getEnvironment().getProperty("aai.endpoint"); this.encryptedBasicAuth = context.getEnvironment().getProperty("aai.auth"); this.encrytptionKey = context.getEnvironment().getProperty("mso.key"); + this.aaiVersion = context.getEnvironment().getProperty("aai.version"); + } @Override @@ -53,6 +55,11 @@ public class AaiPropertiesImpl implements AAIProperties { @Override public AAIVersion getDefaultVersion() { + for (final AAIVersion version : AAIVersion.values()) { + if (version.toString().equalsIgnoreCase(this.aaiVersion)) { + return version; + } + } return AAIVersion.LATEST; } -- cgit 1.2.3-korg