diff options
Diffstat (limited to 'vid-automation/src')
-rw-r--r-- | vid-automation/src/test/java/org/onap/vid/api/ServiceTreeApiTest.java | 12 |
1 files changed, 8 insertions, 4 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 82cc72081..f8bdc97e2 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 @@ -179,8 +179,7 @@ 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); + LoggerFormatTest.assertHeadersAndMetricLogs(restTemplate, uri, echoedRequestId(responseEntity), "/network/generic-vnfs/generic-vnf/", 5); } @Test @@ -292,9 +291,14 @@ public class ServiceTreeApiTest extends BaseApiTest { .replace("NETWORK4_INSTANCE_NAME", l3NetworkPreset4.getInstanceName()) .replace("NETWORK4_INSTANCE_ID", l3NetworkPreset4.getInstanceId()); - String response = restTemplate.getForObject(buildUri(API_URL), String.class, "global-customer-id", "service-instance-type", "service-instance-id"); + ResponseEntity<String> response = restTemplate.getForEntity(buildUri(API_URL), String.class, "global-customer-id", "service-instance-type", "service-instance-id"); - assertJsonEquals(response, expected); + assertJsonEquals(response.getBody(), expected); + LoggerFormatTest.assertHeadersAndMetricLogs(restTemplate, uri, echoedRequestId(response), "/vf-modules", 2); + } + + private String echoedRequestId(ResponseEntity<?> response) { + return response.getHeaders().getFirst("X-ECOMP-RequestID-echo"); } @Override |