summaryrefslogtreecommitdiffstats
path: root/vid-automation
diff options
context:
space:
mode:
authorEinat Vinouze <einat.vinouze@intl.att.com>2019-11-04 11:20:29 +0200
committerEinat Vinouze <einat.vinouze@intl.att.com>2019-11-04 11:20:29 +0200
commit3ae52e57505549227bd30fbbd5cd45239858cfe7 (patch)
treee2440d710a8300f29da9020f2276d367fff8a379 /vid-automation
parent46d7ba49211c86e9208d6634461afc6ebac70f8d (diff)
fix - when retrieve topology we are using threadPool and the MDC values are not updated
Issue-ID: VID-253 Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com> Change-Id: I275d1768f17764efc1bde36baf53439922b534ab Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Diffstat (limited to 'vid-automation')
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/ServiceTreeApiTest.java9
-rw-r--r--vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java2
2 files changed, 8 insertions, 3 deletions
diff --git a/vid-automation/src/test/java/org/onap/vid/api/ServiceTreeApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/ServiceTreeApiTest.java
index e5a2a739b..82cc72081 100644
--- a/vid-automation/src/test/java/org/onap/vid/api/ServiceTreeApiTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/api/ServiceTreeApiTest.java
@@ -31,6 +31,7 @@ import org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet;
import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet;
import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceMetadataGet;
import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceToscaModelGet;
+import org.onap.vid.more.LoggerFormatTest;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.testng.ITestResult;
@@ -150,13 +151,15 @@ public class ServiceTreeApiTest extends BaseApiTest {
new PresetAAIGetCloudRegionFromVnf(vnfPreset1.getInstanceId()),
new PresetAAIGetCloudRegionFromVnf(vnfPreset2.getInstanceId()),
new PresetAAIGetCloudRegionFromVnf(vnfPreset3.getInstanceId()),
- new PresetAAIGetCloudRegionFromVnf(vnfPreset4.getInstanceId())
+ new PresetAAIGetCloudRegionFromVnf(vnfPreset4.getInstanceId()),
+ new PresetAAIGetSubscribersGet()
), CLEAR_THEN_SET);
String api_url = "aai_search_group_members?subscriberId={subscriberId}&serviceType={serviceType}&serviceInvariantId={serviceInvariantId}" +
"&groupType={groupType}&groupRole={groupRole}";
- final String response = restTemplate.getForObject(buildUri(api_url), String.class, "global-customer-id", "service-instance-type", "24632e6b-584b-4f45-80d4-fefd75fd9f14", "LOAD-GROUP", "SERVICE-ACCESS");
+ final ResponseEntity<String> responseEntity = restTemplate.getForEntity(buildUri(api_url), String.class, "global-customer-id", "service-instance-type", "24632e6b-584b-4f45-80d4-fefd75fd9f14", "LOAD-GROUP", "SERVICE-ACCESS");
+ String response = responseEntity.getBody();
LOGGER.info(response);
@@ -176,6 +179,8 @@ public class ServiceTreeApiTest extends BaseApiTest {
.replace("VNF4_INSTANCE_TYPE", vnfPreset4.getInstanceType());
assertJsonEquals(response, expected);
+ final String requestId = responseEntity.getHeaders().getFirst("X-ECOMP-RequestID-echo");
+ LoggerFormatTest.assertHeadersAndMetricLogs(restTemplate, uri, requestId, "/network/generic-vnfs/generic-vnf/", 5);
}
@Test
diff --git a/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java b/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java
index 6638a0e23..a233f255e 100644
--- a/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java
@@ -167,7 +167,7 @@ public class LoggerFormatTest extends BaseApiTest {
}
public static void assertIdsInMetricsLog(List<String> logLines, String requestId, String invocationId) {
- assertThat("request id and invocation id must be found in exactly two rows",
+ assertThat("request id and invocation id must be found in exactly two rows in: \n" + String.join("\n", logLines),
logLines,
containsInRelativeOrder(
allOf(