Removed redundant env vars 93/133793/1
authorGuangrong Fu <fu.guangrong@zte.com.cn>
Fri, 24 Mar 2023 01:43:46 +0000 (09:43 +0800)
committerGuangrong Fu <fu.guangrong@zte.com.cn>
Fri, 24 Mar 2023 01:43:46 +0000 (09:43 +0800)
Issue-ID: HOLMES-613
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Change-Id: I754658a0ce3172dffd4e4dd28a95922d5eb7d991

holmes-actions/pom.xml
holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java
holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQuery4Ccvpn2Test.java
holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQuery4CcvpnTest.java
holmes-actions/src/test/java/org/onap/holmes/common/aai/AaiQueryMdonsTest.java
pom.xml

index cec3209..b09b882 100644 (file)
@@ -12,7 +12,7 @@
     <parent>\r
         <groupId>org.onap.holmes.common</groupId>\r
         <artifactId>holmes-common-parent</artifactId>\r
     <parent>\r
         <groupId>org.onap.holmes.common</groupId>\r
         <artifactId>holmes-common-parent</artifactId>\r
-        <version>1.4.5-SNAPSHOT</version>\r
+        <version>1.4.6-SNAPSHOT</version>\r
     </parent>\r
 \r
     <name>holmes-common-service</name>\r
     </parent>\r
 \r
     <name>holmes-common-service</name>\r
index 621e23b..4702d7b 100644 (file)
@@ -33,13 +33,10 @@ public class MicroServiceConfig {
     final static public String HOSTNAME = "HOSTNAME";
     final static public String POD_IP = "POD_IP";
     final static public String CONFIG_BINDING_SERVICE = "CONFIG_BINDING_SERVICE";
     final static public String HOSTNAME = "HOSTNAME";
     final static public String POD_IP = "POD_IP";
     final static public String CONFIG_BINDING_SERVICE = "CONFIG_BINDING_SERVICE";
-    final static public String MSB_ADDR = "MSB_ADDR";
     final static public String MSB_IAG_SERVICE_HOST = "MSB_IAG_SERVICE_HOST";
     final static public String MSB_IAG_SERVICE_PORT = "MSB_IAG_SERVICE_PORT";
     final static public String MSB_IAG_SERVICE_HOST = "MSB_IAG_SERVICE_HOST";
     final static public String MSB_IAG_SERVICE_PORT = "MSB_IAG_SERVICE_PORT";
-    final static public String BASE_URL = "BASE_URL";
-    final static public String PRE_ADDR = "PRE_ADDR";
-    final static public String POST_ADDR = "POST_ADDR";
     final static public String AAI_ADDR = "AAI_ADDR";
     final static public String AAI_ADDR = "AAI_ADDR";
+    final static public String NAMESPACE = "NAMESPACE";
     final static public String PROTOCOL_HTTP = "http";
     final static public String PROTOCOL_HTTPS = "https";
     final static public int PLAIN_PORT = 80;
     final static public String PROTOCOL_HTTP = "http";
     final static public String PROTOCOL_HTTPS = "https";
     final static public int PLAIN_PORT = 80;
@@ -97,12 +94,10 @@ public class MicroServiceConfig {
     public static String getAaiAddr() {
         boolean tlsEnabled = Boolean.valueOf(getEnv("ENABLE_ENCRYPT"));
 
     public static String getAaiAddr() {
         boolean tlsEnabled = Boolean.valueOf(getEnv("ENABLE_ENCRYPT"));
 
-        return String.format("%s://%s%s%s.%s:%d",
+        return String.format("%s://%s.%s:%d",
                 tlsEnabled ? PROTOCOL_HTTPS : PROTOCOL_HTTP,
                 tlsEnabled ? PROTOCOL_HTTPS : PROTOCOL_HTTP,
-                nullToEmptyString(getEnv(PRE_ADDR)),
                 nullToEmptyString(getEnv(AAI_ADDR)),
                 nullToEmptyString(getEnv(AAI_ADDR)),
-                nullToEmptyString(getEnv(POST_ADDR)),
-                nullToEmptyString(getEnv(BASE_URL)),
+                nullToEmptyString(getEnv(NAMESPACE)),
                 tlsEnabled ? TLS_PORT : PLAIN_PORT);
     }
 
                 tlsEnabled ? TLS_PORT : PLAIN_PORT);
     }
 
index 9b9d75c..18b0fe0 100644 (file)
@@ -44,8 +44,6 @@ import java.util.Map;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 import static org.hamcrest.core.IsNull.nullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 import static org.hamcrest.core.IsNull.nullValue;
-import static org.onap.holmes.common.config.MicroServiceConfig.MSB_ADDR;
-
 
 @RunWith(PowerMockRunner.class)
 @PrepareForTest({JerseyClient.class})
 
 @RunWith(PowerMockRunner.class)
 @PrepareForTest({JerseyClient.class})
@@ -61,7 +59,6 @@ public class AaiQuery4Ccvpn2Test {
 
     @BeforeClass
     static public void beforeClass() {
 
     @BeforeClass
     static public void beforeClass() {
-        System.setProperty(MSB_ADDR, "127.0.0.1:80");
 
         File file = new File(AaiQuery4Ccvpn2Test.class.getClassLoader().getResource("./ccvpn2.data.json").getFile());
         BufferedReader reader = null;
 
         File file = new File(AaiQuery4Ccvpn2Test.class.getClassLoader().getResource("./ccvpn2.data.json").getFile());
         BufferedReader reader = null;
index 55e7b6b..0430e28 100644 (file)
@@ -36,8 +36,6 @@ import static org.easymock.EasyMock.anyObject;
 import static org.easymock.EasyMock.anyString;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
 import static org.easymock.EasyMock.anyString;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
-import static org.onap.holmes.common.config.MicroServiceConfig.MSB_ADDR;
-
 
 @RunWith(PowerMockRunner.class)
 @PrepareForTest(JerseyClient.class)
 
 @RunWith(PowerMockRunner.class)
 @PrepareForTest(JerseyClient.class)
@@ -56,8 +54,6 @@ public class AaiQuery4CcvpnTest {
 
     @BeforeClass
     static public void beforeClass() {
 
     @BeforeClass
     static public void beforeClass() {
-        System.setProperty(MSB_ADDR, "127.0.0.1:80");
-
         File file = new File(AaiQuery4CcvpnTest.class.getClassLoader().getResource("./ccvpn.data.json").getFile());
         BufferedReader reader = null;
         try {
         File file = new File(AaiQuery4CcvpnTest.class.getClassLoader().getResource("./ccvpn.data.json").getFile());
         BufferedReader reader = null;
         try {
index 8b176eb..6c038c2 100644 (file)
@@ -38,7 +38,6 @@ import java.util.Map;
 
 import static org.easymock.EasyMock.anyObject;
 import static org.junit.Assert.assertEquals;
 
 import static org.easymock.EasyMock.anyObject;
 import static org.junit.Assert.assertEquals;
-import static org.onap.holmes.common.config.MicroServiceConfig.MSB_ADDR;
 
 @RunWith(PowerMockRunner.class)
 @PowerMockIgnore("javax.net.ssl.*")
 
 @RunWith(PowerMockRunner.class)
 @PowerMockIgnore("javax.net.ssl.*")
@@ -57,10 +56,9 @@ public class AaiQueryMdonsTest {
 
     @BeforeClass
     public static void beforeClass() {
 
     @BeforeClass
     public static void beforeClass() {
-        System.setProperty(MSB_ADDR, "127.0.0.1:80");
         System.setProperty("ENABLE_ENCRYPT", "true");
         System.setProperty(MicroServiceConfig.AAI_ADDR, "aai");
         System.setProperty("ENABLE_ENCRYPT", "true");
         System.setProperty(MicroServiceConfig.AAI_ADDR, "aai");
-        System.setProperty(MicroServiceConfig.BASE_URL, "onap");
+        System.setProperty(MicroServiceConfig.NAMESPACE, "onap");
 
         File file = new File(AaiQueryMdonsTest.class.getClassLoader().getResource("./aai-mdons.json").getFile());
         BufferedReader reader = null;
 
         File file = new File(AaiQueryMdonsTest.class.getClassLoader().getResource("./aai-mdons.json").getFile());
         BufferedReader reader = null;
diff --git a/pom.xml b/pom.xml
index a0de13b..2af85ea 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
     <artifactId>holmes-common-parent</artifactId>\r
     <packaging>pom</packaging>\r
 \r
     <artifactId>holmes-common-parent</artifactId>\r
     <packaging>pom</packaging>\r
 \r
-    <version>1.4.5-SNAPSHOT</version>\r
+    <version>1.4.6-SNAPSHOT</version>\r
     <name>holmes-common</name>\r
     <modules>\r
         <module>holmes-actions</module>\r
     <name>holmes-common</name>\r
     <modules>\r
         <module>holmes-actions</module>\r