summaryrefslogtreecommitdiffstats
path: root/vid-automation/src
diff options
context:
space:
mode:
Diffstat (limited to 'vid-automation/src')
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java2
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/ChangeManagementMsoApiLoggingTest.java36
2 files changed, 38 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java
index 1cfdd8866..a36d35e91 100644
--- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/BasePresets/BaseMSOPreset.java
@@ -49,6 +49,8 @@ public abstract class BaseMSOPreset extends BasePreset {
Map<String, String> map = super.getRequestHeaders();
map.put("X-ONAP-PartnerName", "VID.VID");
map.put("X-ECOMP-RequestID", "[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}");
+ map.put("X-ONAP-InvocationID", "[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}");
+ map.put("X-ONAP-RequestID", "[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}");
return map;
}
}
diff --git a/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementMsoApiLoggingTest.java b/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementMsoApiLoggingTest.java
new file mode 100644
index 000000000..6e29a971f
--- /dev/null
+++ b/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementMsoApiLoggingTest.java
@@ -0,0 +1,36 @@
+package org.onap.vid.api;
+
+import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet;
+import org.onap.vid.more.LoggerFormatTest;
+import org.springframework.http.ResponseEntity;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import vid.automation.test.services.SimulatorApi;
+import vid.automation.test.services.SimulatorApi.RegistrationStrategy;
+
+public class ChangeManagementMsoApiLoggingTest extends BaseApiTest {
+
+ public static final String MSO = "/mso";
+ public static final String CHANGE_MANAGEMENT = "change-management";
+ public static final String MSO_GET_CHANGE_MANAGEMENTS_SCALEOUT ="changeManagement/mso_get_change_managements_scaleout.json";
+ public static final String MSO_GET_CHANGE_MANAGEMENTS = "changeManagement/mso_get_change_managements.json";
+
+
+ @BeforeClass
+ public void login() {
+ super.login();
+ }
+
+ @Test
+ public void testGetOrchestrationRequestsLoggedInMetricsLog () {
+ SimulatorApi.registerExpectation(MSO_GET_CHANGE_MANAGEMENTS_SCALEOUT, RegistrationStrategy.CLEAR_THEN_SET);
+ SimulatorApi.registerExpectation(MSO_GET_CHANGE_MANAGEMENTS, RegistrationStrategy.APPEND);
+ SimulatorApi.registerExpectationFromPreset( new PresetAAIGetSubscribersGet(), RegistrationStrategy.APPEND);
+
+ ResponseEntity<String> responseEntity = restTemplate.getForEntity(buildUri(CHANGE_MANAGEMENT + MSO ), String.class);
+ String requestId = responseEntity.getHeaders().getFirst("X-ECOMP-RequestID-echo");
+
+ LoggerFormatTest.assertHeadersAndMetricLogs(restTemplate, uri, requestId, "/mso/orchestrationRequests/", 2);
+ }
+
+}