diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2019-09-05 15:52:17 +0300 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2019-09-05 15:57:12 +0300 |
commit | a855f8d76f3fbedcf7696eb91d34a4912d55114a (patch) | |
tree | 64d6afe0a7e35f547d4409345a7df0d8ea62c6b0 /vid-app-common | |
parent | 435d688a7ae71c726ca7e96f8d0bb61d01afb592 (diff) |
send X-ONAP-RequestID header from MSO client
Issue-ID: VID-378
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Change-Id: Icf215cf8b9711a63561740b22c035595f5281f58
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-app-common')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java | 6 | ||||
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTestUtil.java | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java index cc6d6123d..743e2a16e 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java @@ -20,6 +20,8 @@ */ package org.onap.vid.mso.rest; +import static org.onap.vid.utils.Logging.ONAP_REQUEST_ID_HEADER_KEY; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import io.joshworks.restclient.http.HttpResponse; @@ -552,8 +554,10 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf map.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); map.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); map.put(X_FROM_APP_ID, systemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)); - map.put(SystemProperties.ECOMP_REQUEST_ID, Logging.extractOrGenerateRequestId()); map.put(X_ONAP_PARTNER_NAME, "VID"); + String requestIdValue = Logging.extractOrGenerateRequestId(); + map.put(SystemProperties.ECOMP_REQUEST_ID, requestIdValue); + map.put(ONAP_REQUEST_ID_HEADER_KEY, requestIdValue); return ImmutableMap.copyOf(map); } diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTestUtil.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTestUtil.java index f66235728..ac82a6e53 100644 --- a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTestUtil.java +++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTestUtil.java @@ -32,6 +32,8 @@ import static com.xebialabs.restito.semantics.Condition.post; import static com.xebialabs.restito.semantics.Condition.uri; import static com.xebialabs.restito.semantics.Condition.withHeader; import static net.javacrumbs.jsonunit.JsonAssert.assertJsonEquals; +import static org.onap.vid.mso.rest.MsoRestClientNew.X_ONAP_PARTNER_NAME; +import static org.onap.vid.utils.Logging.ONAP_REQUEST_ID_HEADER_KEY; import com.fasterxml.jackson.databind.ObjectMapper; import com.xebialabs.restito.semantics.Action; @@ -233,7 +235,10 @@ class MsoRestClientTestUtil implements AutoCloseable { withHeader(HttpHeaders.ACCEPT), withHeader(HttpHeaders.CONTENT_TYPE), withHeader(MsoRestClientNew.X_FROM_APP_ID), - withHeader(SystemProperties.ECOMP_REQUEST_ID)); + withHeader(X_ONAP_PARTNER_NAME, "VID"), + withHeader(SystemProperties.ECOMP_REQUEST_ID), + withHeader(ONAP_REQUEST_ID_HEADER_KEY) + ); } private Action jsonContent(String str) { |