summaryrefslogtreecommitdiffstats
path: root/common/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/test')
-rw-r--r--common/src/test/java/org/onap/so/adapter_utils/tests/MsoLoggerTest.java331
-rw-r--r--common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java14
-rw-r--r--common/src/test/java/org/onap/so/client/aai/AAIPServerTest.java1
-rw-r--r--common/src/test/java/org/onap/so/client/aai/AAIResourcesClientWithServiceInstanceUriTest.java20
-rw-r--r--common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java8
-rw-r--r--common/src/test/java/org/onap/so/client/grm/GRMClientTest.java118
-rw-r--r--common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java71
-rw-r--r--common/src/test/resources/__files/Policy/configJson.json23
-rw-r--r--common/src/test/resources/__files/Policy/policyConfig.json20
-rw-r--r--common/src/test/resources/logback-test.xml189
-rw-r--r--common/src/test/resources/mso-bad.json20
-rw-r--r--common/src/test/resources/mso.json21
-rw-r--r--common/src/test/resources/mso.properties28
-rw-r--r--common/src/test/resources/mso2.json20
-rw-r--r--common/src/test/resources/mso2.properties22
15 files changed, 223 insertions, 683 deletions
diff --git a/common/src/test/java/org/onap/so/adapter_utils/tests/MsoLoggerTest.java b/common/src/test/java/org/onap/so/adapter_utils/tests/MsoLoggerTest.java
deleted file mode 100644
index 29ac91c864..0000000000
--- a/common/src/test/java/org/onap/so/adapter_utils/tests/MsoLoggerTest.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.adapter_utils.tests;
-
-import org.onap.so.entity.MsoRequest;
-import org.onap.so.logger.MessageEnum;
-import org.onap.so.logger.MsoLogger;
-import org.onap.so.logger.MsoLogger.ErrorCode;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.slf4j.MDC;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.List;
-
-/**
- * This class implements all test methods of the MsoLogger features.
- *
- *
- */
-public class MsoLoggerTest {
-
- static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL, MsoLoggerTest.class);
-
- /**
- * This method is called before any test occurs. It creates a fake tree from
- * scratch
- */
- @BeforeClass
- public static final void prepare() {
-
- }
-
- @Before
- public final void cleanErrorLogFile() throws FileNotFoundException {
- URL url = this.getClass().getClassLoader().getResource("logback-test.xml");
- String logFile = url.getFile().substring(0, url.getFile().indexOf("test-classes"))
- + "/MSO/Test/errorjboss.server.name_IS_UNDEFINED.log";
- PrintWriter asdcConfigFileWriter = new PrintWriter(logFile);
- asdcConfigFileWriter.print("");
- asdcConfigFileWriter.flush();
- asdcConfigFileWriter.close();
- }
-
- @Before
- public final void cleanMetricLogFile() throws FileNotFoundException {
- URL url = this.getClass().getClassLoader().getResource("logback-test.xml");
- String logFile = url.getFile().substring(0, url.getFile().indexOf("test-classes"))
- + "/MSO/Test/metricsjboss.server.name_IS_UNDEFINED.log";
- PrintWriter asdcConfigFileWriter = new PrintWriter(logFile);
- asdcConfigFileWriter.print("");
- asdcConfigFileWriter.flush();
- asdcConfigFileWriter.close();
- }
-
- @Before
- public final void cleanAuditLogFile() throws FileNotFoundException {
- URL url = this.getClass().getClassLoader().getResource("logback-test.xml");
- String logFile = url.getFile().substring(0, url.getFile().indexOf("test-classes"))
- + "/MSO/Test/auditjbo.server.name_IS_UNDEFINED.log";
- PrintWriter asdcConfigFileWriter = new PrintWriter(logFile);
- asdcConfigFileWriter.print("");
- asdcConfigFileWriter.flush();
- asdcConfigFileWriter.close();
- }
-
- /**
- * This method implements a test of getSeverifyLevel method.
- */
- @Test
- public final void testGetSeverityLevel() {
-
- try {
- String levelInfo = (String) invokePriveMethod("getSeverityLevel", "INFO");
- Assert.assertEquals(levelInfo, "0");
-
- String levelWarn = (String) invokePriveMethod("getSeverityLevel", "WARN");
- Assert.assertEquals(levelWarn, "1");
-
- String levelERROR = (String) invokePriveMethod("getSeverityLevel", "ERROR");
- Assert.assertEquals(levelERROR, "2");
-
- String levelDEBUG = (String) invokePriveMethod("getSeverityLevel", "DEBUG");
- Assert.assertEquals(levelDEBUG, "0");
-
- String levelFATAL = (String) invokePriveMethod("getSeverityLevel", "FATAL");
- Assert.assertEquals(levelFATAL, "3");
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- /**
- * This method implements a test of getFinalServiceName method.
- */
- @Test
- public final void testGetFinalServiceName() {
- try {
- String serviceName1 = (String) invokePriveMethod("getFinalServiceName", "testServiceName1");
- Assert.assertEquals(serviceName1, "testServiceName1");
-
- MsoLogger.setServiceName("testServiceName2");
- String serviceName2 = (String) invokePriveMethod("getFinalServiceName", "testServiceName1");
- Assert.assertEquals(serviceName2, "testServiceName1");
-
- String msgNull = null;
- String serviceName3 = (String) invokePriveMethod("getFinalServiceName", msgNull);
- Assert.assertEquals(serviceName3, "testServiceName2");
-
- MsoLogger.resetServiceName();
- String serviceName4 = (String) invokePriveMethod("getFinalServiceName", msgNull);
- Assert.assertEquals(serviceName4, "invoke0");
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @Test
- public final void testPrepareMsg() {
- try {
- String msgNull = null;
- MDC.clear();
- invokePrepareMsg("INFO", null, null);
-
- Assert.assertTrue(MDC.get(MsoLogger.REQUEST_ID).equals("trace-#")
- && MDC.get(MsoLogger.SERVICE_INSTANCE_ID).equals("trace-#")
- && MDC.get(MsoLogger.SERVICE_NAME).equals("invoke0") && MDC.get(MsoLogger.TIMER) == null
- && MDC.get(MsoLogger.ALERT_SEVERITY).equals("0"));
-
- MsoLogger.setLoggerParameters("testRemoteIp", "testUser");
- MsoLogger.setLogContext("testReqId", "testSvcId");
- invokePrepareMsg("ERROR", "testServiceName3", null);
- Assert.assertTrue(MDC.get(MsoLogger.REQUEST_ID).equals("testReqId")
- && MDC.get(MsoLogger.SERVICE_INSTANCE_ID).equals("testSvcId")
- && MDC.get(MsoLogger.SERVICE_NAME).equals("testServiceName3") && MDC.get(MsoLogger.TIMER) == null
- && MDC.get(MsoLogger.ALERT_SEVERITY).equals("2"));
-
- MsoLogger.setServiceName("testServiceName2");
- invokePrepareMsg("WARN", msgNull, msgNull);
- Assert.assertTrue(MDC.get(MsoLogger.REQUEST_ID).equals("testReqId")
- && MDC.get(MsoLogger.SERVICE_INSTANCE_ID).equals("testSvcId")
- && MDC.get(MsoLogger.SERVICE_NAME).equals("testServiceName2") && MDC.get(MsoLogger.TIMER) == null
- && MDC.get(MsoLogger.ALERT_SEVERITY).equals("1"));
-
- MDC.clear();
- MsoRequest msoRequest = new MsoRequest();
- msoRequest.setRequestId("reqId2");
- msoRequest.setServiceInstanceId("servId2");
- MsoLogger.setLogContext(msoRequest);
- invokePrepareMsg("FATAL", null, "123");
- Assert.assertTrue(MDC.get(MsoLogger.REQUEST_ID).equals("reqId2")
- && MDC.get(MsoLogger.SERVICE_INSTANCE_ID).equals("servId2")
- && MDC.get(MsoLogger.TIMER).equals("123") && MDC.get(MsoLogger.ALERT_SEVERITY).equals("3"));
-
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- /**
- * This method implements a test of log methods
- */
- @Test
- @Ignore
- public final void testLogMethods() {
- try {
- MDC.clear();
- MsoLogger.setLogContext("reqId2", "servId2");
- MsoLogger.setServiceName("MSO.testServiceName");
- msoLogger.info(MessageEnum.LOGGER_UPDATE_SUC, "testLogger", "INFO", "DEBUG", "target entity",
- "target service");
- msoLogger.warn(MessageEnum.GENERAL_WARNING, "warning test", "", "", MsoLogger.ErrorCode.UnknownError,
- "warning test");
- msoLogger.error(MessageEnum.GENERAL_EXCEPTION, "target entity", "target service",
- MsoLogger.ErrorCode.UnknownError, "error test");
-
- // Fetch from the error log
- URL url = this.getClass().getClassLoader().getResource("logback-test.xml");
- String logFile = url.getFile().substring(0, url.getFile().indexOf("test-classes"))
- + "/MSO/Test/errorjboss.server.name_IS_UNDEFINED.log";
-
- Path filePath = new File(logFile).toPath();
- Charset charset = Charset.defaultCharset();
- List<String> stringList = Files.readAllLines(filePath, charset);
- String[] stringArray = stringList.toArray(new String[] {});
- int size = stringArray.length;
-
- Assert.assertTrue(stringArray[size - 3]
- .contains("|reqId2|main|MSO.testServiceName||target entity|target service|INFO|null||")
- && stringArray[size - 3].contains(
- "||MSO-GENERAL-5408I Successfully update Logger: testLogger from level INFO to level DEBUG"));
- Assert.assertTrue(stringArray[size - 2]
- .contains("|reqId2|main|MSO.testServiceName||||WARN|UnknownError|warning test|")
- && stringArray[size - 2].contains("|MSO-GENERAL-5401W WARNING: warning test"));
- Assert.assertTrue(stringArray[size - 1].contains(
- "|reqId2|main|MSO.testServiceName||target entity|target service|ERROR|UnknownError|error test|")
- && stringArray[size - 1].contains("|MSO-GENERAL-9401E Exception encountered"));
-
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- /**
- * This method implements a test of recordMetricEvent method.
- *
- * @throws IOException
- */
- @Test
- @Ignore
- public final void testRecordMetricEvent() throws IOException {
- MDC.clear();
- MsoLogger.setLogContext("reqId", "servId");
- msoLogger.recordMetricEvent(123456789L, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful",
- "VNF", "createVNF", null);
- MDC.put(MsoLogger.REMOTE_HOST, "127.0.0.1");
- MDC.put(MsoLogger.PARTNERNAME, "testUser");
- msoLogger.recordMetricEvent(123456789L, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.ServiceNotAvailable,
- "Exception", "SDNC", "removeSDNC", "testVNF");
-
- // Fetch from the metric log
- URL url = this.getClass().getClassLoader().getResource("logback-test.xml");
- String logFile = url.getFile().substring(0, url.getFile().indexOf("test-classes"))
- + "/MSO/Test/metricsjboss.server.name_IS_UNDEFINED.log";
-
- Path filePath = new File(logFile).toPath();
- Charset charset = Charset.defaultCharset();
- List<String> stringList = Files.readAllLines(filePath, charset);
- String[] stringArray = stringList.toArray(new String[] {});
- msoLogger.error(MessageEnum.GENERAL_EXCEPTION, "", "", MsoLogger.ErrorCode.UnknownError, "test error msg");
-
- Assert.assertTrue(stringArray[0]
- .contains("|reqId|servId|main||testRecordMetricEvent||VNF|createVNF|COMPLETE|0|Successful|"));
- // count the occurance of symbol "|"
- Assert.assertTrue((stringArray[0].length() - stringArray[0].replace("|", "").length()) == 28);
- Assert.assertTrue(stringArray[1]
- .contains("|reqId|servId|main||testRecordMetricEvent|testUser|SDNC|removeSDNC|ERROR|501|Exception|")
- && stringArray[1].contains("|127.0.0.1||||testVNF|||||"));
- Assert.assertTrue((stringArray[1].length() - stringArray[1].replace("|", "").length()) == 28);
- }
-
- /**
- * This method implements a test of testRecordAuditEvent method.
- */
-
- // User reflection to invoke to avoid change the publicity of the method
- private static String invokePrepareMsg(String arg1, String arg2, String arg3) {
- Method method;
- try {
- method = MsoLogger.class.getDeclaredMethod("prepareMsg", String.class, String.class, String.class);
- method.setAccessible(true);
- return (String) method.invoke(msoLogger, arg1, arg2, arg3);
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- // User reflection to invoke to avoid change the publicity of the method
- private static Object invokePriveMethod(String methodName, String arg) {
- Method method;
- try {
- method = MsoLogger.class.getDeclaredMethod(methodName, String.class);
- method.setAccessible(true);
- return method.invoke(msoLogger, arg);
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java b/common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java
index ce90ccdc0e..ea842719e8 100644
--- a/common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java
@@ -52,4 +52,18 @@ public class AAIObjectTypeTest {
AAIUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.COLLECTION, id);
assertEquals("/network/collections/collection/test1", aaiUri.build().toString());
}
+
+ @Test
+ public void genericVnfTest() {
+ AAIObjectType type = AAIObjectType.GENERIC_VNF;
+ assertEquals("/network/generic-vnfs/generic-vnf/{vnf-id}", type.uriTemplate());
+ assertEquals("/generic-vnfs/generic-vnf/{vnf-id}", type.partialUri());
+ }
+
+ @Test
+ public void pInterfaceTest() {
+ AAIObjectType type = AAIObjectType.P_INTERFACE;
+ assertEquals("/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}", type.uriTemplate());
+ assertEquals("/p-interfaces/p-interface/{interface-name}", type.partialUri());
+ }
}
diff --git a/common/src/test/java/org/onap/so/client/aai/AAIPServerTest.java b/common/src/test/java/org/onap/so/client/aai/AAIPServerTest.java
index 1e2e7471f1..37188bc4bc 100644
--- a/common/src/test/java/org/onap/so/client/aai/AAIPServerTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/AAIPServerTest.java
@@ -44,6 +44,7 @@ public class AAIPServerTest {
List<Pserver> list = client.getListOfPservers(json);
assertEquals("", list.get(0).getHostname(), "test");
+ assertEquals("", list.size(), 2);
}
@Test
diff --git a/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientWithServiceInstanceUriTest.java b/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientWithServiceInstanceUriTest.java
index efd60a36a8..3d23213ff0 100644
--- a/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientWithServiceInstanceUriTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientWithServiceInstanceUriTest.java
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
package org.onap.so.client.aai;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
diff --git a/common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java b/common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java
index e40c25a2e2..d4bf1b0224 100644
--- a/common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java
@@ -102,8 +102,12 @@ public class AAIResultWrapperTest {
assertEquals(Optional.empty(), wrapper.asBean(GenericVnf.class));
assertEquals(true, wrapper.asMap().isEmpty());
assertEquals("{}", wrapper.toString());
-
-
}
+
+ @Test
+ public void objectConstructor() {
+ AAIResultWrapper wrapper = new AAIResultWrapper(new GenericVnf());
+ assertEquals("{}", wrapper.getJson());
+ }
}
diff --git a/common/src/test/java/org/onap/so/client/grm/GRMClientTest.java b/common/src/test/java/org/onap/so/client/grm/GRMClientTest.java
index 3cce6a626b..7b783762fa 100644
--- a/common/src/test/java/org/onap/so/client/grm/GRMClientTest.java
+++ b/common/src/test/java/org/onap/so/client/grm/GRMClientTest.java
@@ -24,9 +24,11 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
+import static com.github.tomakehurst.wiremock.client.WireMock.*;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-
+import static org.junit.Assert.fail;
import java.io.File;
import java.nio.file.Files;
import java.util.ArrayList;
@@ -43,6 +45,7 @@ import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.client.grm.beans.OperationalInfo;
import org.onap.so.client.grm.beans.Property;
import org.onap.so.client.grm.beans.ServiceEndPoint;
@@ -54,8 +57,7 @@ import org.onap.so.client.grm.exceptions.GRMClientCallFailed;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
-import org.onap.so.logger.MsoLogger;
-import org.onap.so.logger.MsoLogger.Catalog;
+
import org.onap.so.utils.TestAppender;
public class GRMClientTest {
@@ -66,6 +68,8 @@ public class GRMClientTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
+ private static final String uuidRegex = "(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-5][0-9a-f]{3}-?[089ab][0-9a-f]{3}-?[0-9a-f]{12}$";
+
@BeforeClass
public static void setUp() throws Exception {
System.setProperty("mso.config.path", "src/test/resources");
@@ -81,25 +85,45 @@ public class GRMClientTest {
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", MediaType.APPLICATION_JSON)
- .withHeader("X-FromAppId", "GRM")
.withBody(endpoints)));
- MDC.put(MsoLogger.SERVICE_NAME, "my-value");
+ MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, "/test");
GRMClient client = new GRMClient();
ServiceEndPointList sel = client.findRunningServices("TEST.ECOMP_PSL.*", 1, "TEST");
List<ServiceEndPoint> list = sel.getServiceEndPointList();
assertEquals(3, list.size());
- ILoggingEvent logEvent = TestAppender.events.get(0);
- Map<String,String> mdc = logEvent.getMDCPropertyMap();
- assertNotNull(mdc.get(MsoLogger.METRIC_BEGIN_TIME));
- assertNotNull(mdc.get(MsoLogger.METRIC_END_TIME));
- assertNotNull(mdc.get(MsoLogger.REQUEST_ID));
- assertNotNull(mdc.get(MsoLogger.METRIC_TIMER));
- assertEquals("200",mdc.get(MsoLogger.RESPONSECODE));
- assertEquals("GRM",mdc.get(MsoLogger.PARTNERNAME));
- assertEquals("expect value to not be overwritten by jax rs client interceptor", "my-value",mdc.get(MsoLogger.SERVICE_NAME));
- assertEquals("COMPLETE",mdc.get(MsoLogger.STATUSCODE));
- assertNotNull(mdc.get(MsoLogger.RESPONSEDESC));
+
+ boolean foundInvoke = false;
+ boolean foundInvokeReturn = false;
+ for(ILoggingEvent logEvent : TestAppender.events)
+ if(logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.JaxRsClientLogging") &&
+ logEvent.getMarker().getName().equals("INVOKE")
+ ){
+ Map<String,String> mdc = logEvent.getMDCPropertyMap();
+ assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+ assertEquals("GRM",mdc.get("TargetEntity"));
+ assertEquals("INPROGRESS",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+ foundInvoke=true;
+ }else if(logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.JaxRsClientLogging") &&
+ logEvent.getMarker()!= null && logEvent.getMarker().getName().equals("INVOKE_RETURN")){
+ Map<String,String> mdc = logEvent.getMDCPropertyMap();
+ assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
+ assertEquals("200",mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
+ assertEquals("COMPLETED",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
+ foundInvokeReturn=true;
+ }
+
+ if(!foundInvoke)
+ fail("INVOKE Marker not found");
+
+ if(!foundInvokeReturn)
+ fail("INVOKE RETURN Marker not found");
+
+ verify(postRequestedFor(urlEqualTo("/GRMLWPService/v1/serviceEndPoint/findRunning"))
+ .withHeader(ONAPLogConstants.Headers.INVOCATION_ID.toString(), matching(uuidRegex))
+ .withHeader(ONAPLogConstants.Headers.REQUEST_ID.toString(), matching(uuidRegex))
+ .withHeader(ONAPLogConstants.Headers.PARTNER_NAME.toString(), equalTo("SO")));
+ TestAppender.events.clear();
}
@Test
@@ -116,68 +140,6 @@ public class GRMClientTest {
client.findRunningServices("TEST.ECOMP_PSL.*", 1, "TEST");
}
- @Ignore
- @Test
- public void testAdd() throws Exception {
-
- wireMockRule.stubFor(post(urlPathEqualTo("/GRMLWPService/v1/serviceEndPoint/add"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", MediaType.APPLICATION_JSON)
- .withBody("test")));
- wireMockRule.addMockServiceRequestListener((request, response) -> {
- System.out.println("URL Requested => " + request.getAbsoluteUrl());
- System.out.println("Request Body => " + request.getBodyAsString());
- System.out.println("Request Headers => " + request.getHeaders().toString());
- System.out.println("Response Status => " + response.getStatus());
- System.out.println("Response Body => " + response.getBodyAsString());
- });
-
- Version ver = new Version();
- ver.setMajor(1);
- ver.setMinor(0);
- ver.setPatch("0");
-
- ServiceEndPoint sep = new ServiceEndPoint();
- sep.setName("TEST.ECOMP_PSL.Inventory");
- sep.setVersion(ver);
- sep.setHostAddress("127.0.0.1");
- sep.setListenPort("8080");
- sep.setLatitude("37.7022");
- sep.setLongitude("121.9358");
- sep.setContextPath("/");
- sep.setRouteOffer("TEST");
-
- OperationalInfo operInfo = new OperationalInfo();
- operInfo.setCreatedBy("edge");
- operInfo.setUpdatedBy("edge");
-
- sep.setOperationalInfo(operInfo);
-
- Property prop1 = new Property();
- prop1.setName("Environment");
- prop1.setValue("TEST");
-
- Property prop2 = new Property();
- prop2.setName("cpfrun_cluster_name");
- prop2.setValue("testcase_cluster_no_cluster");
-
- List<Property> props = new ArrayList<Property>();
- props.add(prop1);
- props.add(prop2);
-
- sep.setProperties(props);
-
- ServiceEndPointRequest request = new ServiceEndPointRequest();
- request.setEnv("DEV");
- request.setServiceEndPoint(sep);
-
- System.out.println("Request in JSON: " + mapper.writeValueAsString(request));
-
- GRMClient client = new GRMClient();
- client.addServiceEndPoint(request);
- }
-
@Test
public void testAddFail() throws Exception {
wireMockRule.stubFor(post(urlPathEqualTo("/GRMLWPService/v1/serviceEndPoint/add"))
diff --git a/common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java b/common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java
index 104d40f76e..4cb9bd0e16 100644
--- a/common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java
+++ b/common/src/test/java/org/onap/so/client/policy/PolicyClientImplTest.java
@@ -23,8 +23,12 @@ package org.onap.so.client.policy;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
+import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Matchers.any;
+import java.io.File;
+import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -33,16 +37,28 @@ import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;
import org.onap.so.client.defaultproperties.PolicyRestPropertiesImpl;
+import org.onap.so.client.policy.entities.Config;
+import org.onap.so.client.policy.entities.ConfigRequestParameters;
import org.onap.so.client.policy.entities.DictionaryData;
+import org.onap.so.client.policy.entities.PolicyConfig;
import org.onap.so.client.policy.entities.PolicyDecision;
import org.onap.so.client.policy.entities.PolicyServiceType;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
public class PolicyClientImplTest {
-
+
@BeforeClass
public static void setUp() {
System.setProperty("mso.config.path", "src/test/resources");
}
+
+ private static String RESOURCE_PATH = "src/test/resources/__files/Policy/";
+
@Test
public void successReadProperties() {
PolicyRestClient client = new PolicyRestClient(new PolicyRestPropertiesImpl(), PolicyServiceType.GET_DECISION);
@@ -52,7 +68,7 @@ public class PolicyClientImplTest {
assertEquals("Found expected Authorization", "Basic dGVzdHBkcDphbHBoYTEyMw==", map.get("Authorization"));
assertEquals("Found expected Environment", "TEST", map.get("Environment"));
}
-
+
@Test
@Ignore
public void getDecisionTest() {
@@ -61,10 +77,10 @@ public class PolicyClientImplTest {
assertEquals("Decision is correct", decision.getDecision(), "PERMIT");
assertEquals("Decision details is correct", decision.getDetails(), "Retry");
}
-
+
@Test
@Ignore
- public void getAllowedTreatmentsTest(){
+ public void getAllowedTreatmentsTest() {
PolicyClient client = new PolicyClientImpl();
DictionaryData dictClient = client.getAllowedTreatments("BB1", "1");
final String dictBbidString = dictClient.getBbid().getString();
@@ -72,7 +88,7 @@ public class PolicyClientImplTest {
assertEquals("DictionaryData matches a response Bbid", dictBbidString, "BB1");
assertEquals("DicitonaryData matches a response WorkStep", dictWorkStepString, "1");
}
-
+
@Test
public void getDecisionMockTest() {
String serviceType = "S";
@@ -80,11 +96,11 @@ public class PolicyClientImplTest {
String bbID = "BB1";
String workStep = "1";
String errorCode = "123";
-
+
PolicyDecision expected = new PolicyDecision();
expected.setDecision("PERMIT");
expected.setDetails("Retry");
-
+
DecisionAttributes decisionAttributes = new DecisionAttributes();
decisionAttributes.setServiceType(serviceType);
decisionAttributes.setVNFType(vnfType);
@@ -92,20 +108,43 @@ public class PolicyClientImplTest {
decisionAttributes.setWorkStep(workStep);
decisionAttributes.setErrorCode(errorCode);
PolicyClient client = Mockito.spy(PolicyClientImpl.class);
-
+
doReturn(expected).when(client).getDecision(serviceType, vnfType, bbID, workStep, errorCode);
PolicyDecision actual = client.getDecision(serviceType, vnfType, bbID, workStep, errorCode);
assertThat(actual, sameBeanAs(expected));
}
+
+ @Test
+ public void getConfigFromStringJsonTest() throws JsonParseException, JsonMappingException, IOException {
+ PolicyClientImpl client = new PolicyClientImpl();
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
+ mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
+ Config expected = mapper.readValue(new File(RESOURCE_PATH + "configJson.json"), Config.class);
+ PolicyConfig[] returnedPolicyConfigList = mapper.readValue(new File(RESOURCE_PATH + "policyConfig.json"), PolicyConfig[].class);
+ String configJson = returnedPolicyConfigList[0].getConfig();
+ Config actual = client.getConfigFromStringJson(configJson);
+
+ assertThat(actual, sameBeanAs(expected));
+ }
- /*
@Test
- public void getAllowedTreatmentsTest() {
- PolicyClient client = new PolicyClientImpl();
- AllowedTreatments allowedTreatments = client.getAllowedTreatments("BB1", "1");
- int expectedSizeOfList = 4;
- int sizeOfList = allowedTreatments.getAllowedTreatments().size();
- assertEquals("Decision is correct", sizeOfList, expectedSizeOfList);
- }*/
+ public void getConfigWithPolicyNameTest() throws JsonParseException, JsonMappingException, IOException {
+ PolicyClientImpl client = Mockito.spy(PolicyClientImpl.class);
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
+ mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
+ PolicyConfig[] returnedPolicyConfigList = mapper.readValue(new File(RESOURCE_PATH + "policyConfig.json"), PolicyConfig[].class);
+ Config expected = mapper.readValue(new File(RESOURCE_PATH + "configJson.json"), Config.class);
+
+ PolicyRestClient mockedClient = Mockito.mock(PolicyRestClient.class);
+ doReturn(mockedClient).when(client).getPolicyRestClient(PolicyServiceType.GET_CONFIG);
+ doReturn(returnedPolicyConfigList).when(mockedClient).post(isA(ConfigRequestParameters.class), any());
+
+ Config actual = client.getConfigWithPolicyName("policyName");
+
+ assertThat(actual, sameBeanAs(expected));
+
+ }
}
diff --git a/common/src/test/resources/__files/Policy/configJson.json b/common/src/test/resources/__files/Policy/configJson.json
new file mode 100644
index 0000000000..b206998b41
--- /dev/null
+++ b/common/src/test/resources/__files/Policy/configJson.json
@@ -0,0 +1,23 @@
+{
+ "configName": "Testing",
+ "riskLevel": "1",
+ "policyName": "fabric_configuration",
+ "policyScope": "resource=Test1,service=vSCP,type=configuration,closedLoopControlName=Firewall",
+ "guard": "False",
+ "description": "null",
+ "priority": "9",
+ "uuid": "1234",
+ "version": "1.0",
+ "content": {
+ "fabric-config-models": [
+ {
+ "vnfProfile": "v5",
+ "lagProfile": "N1"
+ }
+ ]
+ },
+ "riskType": "test",
+ "service": "mso-fabric-configuration-model",
+ "location": " Edge",
+ "templateVersion": "1607"
+} \ No newline at end of file
diff --git a/common/src/test/resources/__files/Policy/policyConfig.json b/common/src/test/resources/__files/Policy/policyConfig.json
new file mode 100644
index 0000000000..b67c9c0e48
--- /dev/null
+++ b/common/src/test/resources/__files/Policy/policyConfig.json
@@ -0,0 +1,20 @@
+[
+ {
+ "policyConfigMessage": "Config Retrieved! ",
+ "policyConfigStatus": "CONFIG_RETRIEVED",
+ "type": "JSON",
+ "config": "{\"configName\":\"Testing\",\"riskLevel\":\"1\",\"policyName\":\"fabric_configuration\",\"policyScope\":\"resource=Test1,service=vSCP,type=configuration,closedLoopControlName=Firewall\",\"guard\":\"False\",\"description\":\"null\",\"priority\":\"9\",\"uuid\":\"1234\",\"version\":\"1.0\",\"content\":{\"fabric-config-models\":[{\"vnfProfile\":\"v5\",\"lagProfile\":\"N1\"}]},\"riskType\":\"test\",\"service\":\"mso-fabric-configuration-model\",\"location\":\" Edge\",\"templateVersion\":\"1607\"}",
+ "policyName": "MSO_Policy.Config_MS_fabric_configuration_vPE.2.xml",
+ "policyType": "MicroService",
+ "policyVersion": "2",
+ "matchingConditions": {
+ "ECOMPName": "MSO",
+ "ONAPName": "MSO",
+ "service": "mso-fabric-configuration-model"
+ },
+ "responseAttributes": {
+
+ },
+ "property": null
+ }
+] \ No newline at end of file
diff --git a/common/src/test/resources/logback-test.xml b/common/src/test/resources/logback-test.xml
index c4248bf985..772eeabeb6 100644
--- a/common/src/test/resources/logback-test.xml
+++ b/common/src/test/resources/logback-test.xml
@@ -1,8 +1,8 @@
<!--
============LICENSE_START=======================================================
- ECOMP MSO
+ ONAP SO
================================================================================
- Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -18,159 +18,58 @@
============LICENSE_END=========================================================
-->
-<configuration scan="false" debug="true">
- <!--<jmxConfigurator /> -->
- <!-- directory path for all other type logs -->
+<configuration>
+ <property name="p_tim" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}"/>
+ <property name="p_lvl" value="%level"/>
+ <property name="p_log" value="%logger"/>
+ <property name="p_mdc" value="%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}"/>
+ <property name="p_msg" value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+ <property name="p_exc" value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+ <property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+ <property name="p_thr" value="%thread"/>
+ <property name="pattern" value="%nopexception${p_tim}\t${p_thr}\t${p_lvl}\t${p_log}\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t%n"/>
- <property name="logDir" value="./target" />
-
- <!-- directory path for debugging type logs -->
- <property name="debugDir" value="./target" />
-
- <!-- specify the component name
- <ECOMP-component-name>::= "MSO" | "DCAE" | "ASDC " | "AAI" |"Policy" | "SDNC" | "AC" -->
- <property name="componentName" value="MSO"></property>
- <property name="subComponentName" value="Test"></property>
- <!-- log file names -->
- <property name="errorLogName" value="error" />
- <property name="metricsLogName" value="metrics" />
- <property name="auditLogName" value="audit" />
- <property name="debugLogName" value="debug" />
- <property name="errorPattern" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}|%X{RequestId}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode}|%X{ErrorDesc}|%msg%n" />
- <property name="debugPattern" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}|%X{RequestId}|%msg%n" />
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${pattern}</pattern>
+ </encoder>
+ </appender>
- <property name="auditPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{Timer}|%X{ServerFQDN}|%X{RemoteHost}||||||||%msg%n" />
- <property name="metricPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread||%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{Timer}|%X{ServerFQDN}|%X{RemoteHost}||||%X{TargetVirtualEntity}|||||%msg%n" />
+ <appender name="test"
+ class="org.onap.so.utils.TestAppender" />
- <property name="logDirectory" value="${logDir}/${componentName}/${subComponentName}" />
- <property name="debugLogDirectory" value="${debugDir}/${componentName}/${subComponentName}" />
+ <logger name="com.att.ecomp.audit" level="info" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
- <appender name="test" class="org.onap.so.utils.TestAppender"/>
- <!-- ============================================================================ -->
- <!-- EELF Appenders -->
- <!-- ============================================================================ -->
+ <logger name="com.att.eelf.metrics" level="info" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
- <!-- The EELFAppender is used to record events to the general application
- log -->
-
- <!-- EELF Audit Appender. This appender is used to record audit engine
- related logging events. The audit logger and appender are specializations
- of the EELF application root logger and appender. This can be used to segregate
- Policy engine events from other components, or it can be eliminated to record
- these events as part of the application root log. -->
-
- <appender name="EELFAudit"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${logDirectory}/${auditLogName}${jboss.server.name}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <fileNamePattern>${logDirectory}/${auditLogName}${jboss.server.name}.log.%d</fileNamePattern>
- <!--<maxHistory>30</maxHistory>-->
- </rollingPolicy>
- <encoder>
- <pattern>${auditPattern}</pattern>
- </encoder>
- </appender>
- <appender name="asyncEELFAudit" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>500</queueSize>
- <discardingThreshold>0</discardingThreshold>
- <appender-ref ref="EELFAudit" />
- </appender>
+ <logger name="com.att.eelf.error" level="WARN" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
-<appender name="EELFMetrics"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${logDirectory}/${metricsLogName}${jboss.server.name}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <fileNamePattern>${logDirectory}/${metricsLogName}${jboss.server.name}.log.%d</fileNamePattern>
- <!--<maxHistory>30</maxHistory>-->
- </rollingPolicy>
- <encoder>
- <!-- <pattern>"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} -
- %msg%n"</pattern> -->
- <pattern>${metricPattern}</pattern>
- </encoder>
- </appender>
-
-
- <appender name="asyncEELFMetrics" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>500</queueSize>
- <discardingThreshold>0</discardingThreshold>
- <appender-ref ref="EELFMetrics"/>
- </appender>
-
- <appender name="EELFError"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${logDirectory}/${errorLogName}${jboss.server.name}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <fileNamePattern>${logDirectory}/${errorLogName}${jboss.server.name}.log.%d</fileNamePattern>
- <!--<maxHistory>30</maxHistory>-->
- </rollingPolicy>
- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
- <level>INFO</level>
- </filter>
- <encoder>
- <pattern>${errorPattern}</pattern>
- </encoder>
- </appender>
-
- <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>500</queueSize>
- <discardingThreshold>0</discardingThreshold>
- <appender-ref ref="EELFError"/>
- </appender>
-
- <appender name="EELFDebug"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${debugLogDirectory}/${debugLogName}${jboss.server.name}.log</file>
- <rollingPolicy
- class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <fileNamePattern>${debugLogDirectory}/${debugLogName}${jboss.server.name}.log.%d</fileNamePattern>
- <!--<maxHistory>30</maxHistory>-->
- </rollingPolicy>
- <encoder>
- <pattern>${debugPattern}</pattern>
- </encoder>
- </appender>
-
- <appender name="asyncEELFDebug" class="ch.qos.logback.classic.AsyncAppender">
- <queueSize>500</queueSize>
- <discardingThreshold>0</discardingThreshold>
- <appender-ref ref="EELFDebug" />
- <includeCallerData>true</includeCallerData>
- </appender>
-
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%d{HH:mm:ss.SSS} [%thread] |%X{RequestId}| %-5level
- %logger{1024} - %msg%n
- </pattern>
- </encoder>
- </appender>
+ <logger name="org.onap" level="${so.log.level:-DEBUG}" additivity="false">
+ <appender-ref ref="STDOUT" />
+ <appender-ref ref="test" />
+ </logger>
+
+ <logger name="org.flywaydb" level="DEBUG" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
- <!-- ============================================================================ -->
- <!-- EELF loggers -->
- <!-- ============================================================================ -->
- <logger name="com.att.eelf.audit" level="${so.log.level:-DEBUG}" additivity="false">
- <appender-ref ref="asyncEELFAudit" />
- </logger>
-
- <logger name="METRIC" level="${so.log.level:-DEBUG}" additivity="true">
- <appender-ref ref="asyncEELFMetrics" />
- <appender-ref ref="test" />
- </logger>
+ <logger name="ch.vorburger" level="WARN" additivity="false">
+ <appender-ref ref="STDOUT" />
+ </logger>
+
- <logger name="com.att.eelf.error" level="${so.log.level:-DEBUG}" additivity="false">
- <appender-ref ref="asyncEELFError" />
- </logger>
-
- <root level="${so.log.level:-DEBUG}">
- <appender-ref ref="asyncEELFDebug" />
- <appender-ref ref="STDOUT" />
- </root>
+ <root level="WARN">
+ <appender-ref ref="STDOUT" />
+ <appender-ref ref="test" />
+ </root>
</configuration> \ No newline at end of file
diff --git a/common/src/test/resources/mso-bad.json b/common/src/test/resources/mso-bad.json
deleted file mode 100644
index 1aaea50042..0000000000
--- a/common/src/test/resources/mso-bad.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "asdc-connections": {
- "asdc-controller1": {
- "asdcUser": "user1",
- "asdcConsumerGroup": "consumer1",
- "asdcConsumerId": "consumer1",
- "asdcEnvironmentName": "PROD",
- "asdcAddress": "localhost:8443",
- "asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
- },
- "asdc-controller2": {
- "asdcUser": "user2",
- "asdcConsumerGroup": "consumer2",
- "asdcConsumerId": "consumer2",
- "asdcEnvironmentName": "E2E",
- "asdcAddress": "localhost:8443",
- "asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
- }
- }
-} \ No newline at end of file
diff --git a/common/src/test/resources/mso.json b/common/src/test/resources/mso.json
deleted file mode 100644
index e8ee4a9185..0000000000
--- a/common/src/test/resources/mso.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "asdc-connections":{
- "asdc-controller1":{
- "asdcUser": "user1",
- "asdcConsumerGroup": "consumer1",
- "asdcConsumerId": "consumer1",
- "asdcEnvironmentName": "PROD",
- "asdcAddress": "localhost:8443",
- "asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
- },
- "asdc-controller2":{
- "asdcUser": "user2",
- "asdcConsumerGroup": "consumer2",
- "asdcConsumerId": "consumer2",
- "asdcEnvironmentName": "E2E",
- "asdcAddress": "localhost:8443",
- "asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
- }
- },
- "mso.properties.reload.time.minutes":2
-}
diff --git a/common/src/test/resources/mso.properties b/common/src/test/resources/mso.properties
deleted file mode 100644
index bb0e4ebf0d..0000000000
--- a/common/src/test/resources/mso.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# ECOMP MSO
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-mso.properties.reload.time.minutes=2
-ecomp.mso.cloud.1.cloudId=MT
-ecomp.mso.cloud.1.keystoneUrl=http://localhost:5000/v2.0
-ecomp.mso.cloud.1.msoId=John
-ecomp.mso.cloud.1.publicNetId=FD205490A48D48475607C36B9AD902BF
-ecomp.mso.cloud.1.test=1234
-ecomp.mso.cloud.1.boolean=true
-ecomp.mso.cloud.1.enum=enum1
diff --git a/common/src/test/resources/mso2.json b/common/src/test/resources/mso2.json
deleted file mode 100644
index bac30c495c..0000000000
--- a/common/src/test/resources/mso2.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "asdc-connections": {
- "asdc-controller1": {
- "asdcUser": "user1B",
- "asdcConsumerGroup": "consumer1",
- "asdcConsumerId": "consumer1",
- "asdcEnvironmentName": "PROD",
- "asdcAddress": "localhost:8443",
- "asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
- },
- "asdc-controller2": {
- "asdcUser": "user2B",
- "asdcConsumerGroup": "consumer2",
- "asdcConsumerId": "consumer2",
- "asdcEnvironmentName": "E2E",
- "asdcAddress": "localhost:8443",
- "asdcPassword": "1c551b8b5ab91fcd5a0907b11c304199"
- }
- }
-} \ No newline at end of file
diff --git a/common/src/test/resources/mso2.properties b/common/src/test/resources/mso2.properties
deleted file mode 100644
index 423346e953..0000000000
--- a/common/src/test/resources/mso2.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# ECOMP MSO
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-mso.properties.reload.time.minutes=1
-ecomp.mso.cloud.1.cloudId=MT2