diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2019-04-11 06:38:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-11 06:38:54 +0000 |
commit | 7da2cbad2954e8cf46971f168ab867086b1e026a (patch) | |
tree | acec014bd629077fd097ecf41a403054c28cd067 /bpmn/MSOCommonBPMN | |
parent | 064b021789b6d725dca892727f29c2d294e0d4a9 (diff) | |
parent | 01e155b7a914f2b411bc7d1acefe0d6c72011369 (diff) |
Merge "Support for SO to ExtAPI"
Diffstat (limited to 'bpmn/MSOCommonBPMN')
2 files changed, 5 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy index 918bcdd4cc..64567a349e 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy @@ -143,12 +143,14 @@ class ExternalAPIUtil { String uuid = utils.getRequestID() logger.debug( "Generated uuid is: " + uuid) logger.debug( "URL to be used is: " + url) + logger.debug("URL to be passed in header is: " + execution.getVariable("SPPartnerUrl")) HttpClient client = httpClientFactory.newJsonClient(new URL(url), TargetEntity.EXTERNAL) client.addBasicAuthHeader(execution.getVariable("URN_externalapi_auth"), execution.getVariable("URN_mso_msoKey")) client.addAdditionalHeader("X-FromAppId", "MSO") client.addAdditionalHeader(ONAPLogConstants.Headers.REQUEST_ID, uuid) client.addAdditionalHeader("Accept", MediaType.APPLICATION_JSON) + client.addAdditionalHeader("Target",execution.getVariable("SPPartnerUrl")) apiResponse = client.get() @@ -179,11 +181,13 @@ class ExternalAPIUtil { String uuid = utils.getRequestID() logger.debug( "Generated uuid is: " + uuid) logger.debug( "URL to be used is: " + url) + logger.debug("URL to be passed in header is: " + execution.getVariable("SPPartnerUrl")) HttpClient httpClient = httpClientFactory.newJsonClient(new URL(url), TargetEntity.AAI) httpClient.addBasicAuthHeader(execution.getVariable("URN_externalapi_auth"), execution.getVariable("URN_mso_msoKey")) httpClient.addAdditionalHeader("X-FromAppId", "MSO") httpClient.addAdditionalHeader("X-TransactionId", uuid) + httpClient.addAdditionalHeader("Target",execution.getVariable("SPPartnerUrl")) apiResponse = httpClient.post(payload) diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy index db11cb6044..837bc77f19 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy @@ -146,6 +146,7 @@ class ExternalAPIUtilTest { DelegateExecution delegateExecution = mock(DelegateExecution.class) given(delegateExecution.getVariable("URN_externalapi_auth")).willReturn("value_externalapi_auth") given(delegateExecution.getVariable("URN_mso_msoKey")).willReturn("value_mso_msoKey") + given(delegateExecution.getVariable("SPPartnerUrl")).willReturn("http://LocalExtAPIURL:8080") return delegateExecution } |