From 52b79b57892d03dfe92b6423c77b8f51f0a1ca8d Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Tue, 19 Feb 2019 17:48:46 -0500 Subject: Added the conversion of decrypted value Added jUnit test for the conversion of decrypted value to Basic Base64Binary. Added the conversion of decrypted value as Basic Base64Binary. Change-Id: I361cbe3dac61df2728c9f58c314a21b3cc764a9f Issue-ID: SO-1531 Signed-off-by: Benjamin, Max (mb388a) --- .../org/onap/so/apihandlerinfra/ServiceInstancesTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap') diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java index 5603ee8380..83b5a49e8c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java @@ -2620,4 +2620,16 @@ public class ServiceInstancesTest extends BaseTest{ String serviceType = servInstances.getServiceType(requestScope, sir, aLaCarteFlag); assertEquals(serviceType, "networkModelName"); } + @Test + public void setCamundaHeadersTest()throws ContactCamundaException, RequestDbFailureException{ + String encryptedAuth = "015E7ACF706C6BBF85F2079378BDD2896E226E09D13DC2784BA309E27D59AB9FAD3A5E039DF0BB8408"; // user:password + String key = "07a7159d3bf51a0e53be7a8f89699be7"; + HttpHeaders headers = servInstances.setCamundaHeaders(encryptedAuth, key); + List acceptedType = headers.getAccept(); + String expectedAcceptedType = "application/json"; + assertEquals(expectedAcceptedType, acceptedType.get(0).toString()); + String basicAuth = headers.getFirst(HttpHeaders.AUTHORIZATION); + String expectedBasicAuth = "Basic dXNlcjpwYXNzd29yZA=="; + assertEquals(expectedBasicAuth, basicAuth); + } } -- cgit 1.2.3-korg