diff options
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java index 9c736b7634..a8816e1b04 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java @@ -21,6 +21,7 @@ package org.onap.so.client.sdn.common; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import java.util.LinkedHashMap; import org.junit.Assert; import org.junit.Rule; @@ -29,6 +30,8 @@ import org.junit.rules.ExpectedException; import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.MapperException; import org.onap.so.client.sdnc.SdnCommonTasks; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; public class SdnCommonTasksTest { @@ -53,7 +56,20 @@ public class SdnCommonTasksTest { @Test public void getHttpHeadersTest() { - Assert.assertNotNull(sdnCommonTasks.getHttpHeaders("")); + HttpHeaders result = sdnCommonTasks.getHttpHeaders("auth", true); + + assertEquals("auth", result.getFirst("Authorization")); + assertEquals(MediaType.APPLICATION_JSON.toString(), result.getFirst("Content-Type")); + assertEquals(MediaType.APPLICATION_JSON.toString(), result.getFirst("Accept")); + } + + @Test + public void getHttpHeadersGetRequestTest() { + HttpHeaders result = sdnCommonTasks.getHttpHeaders("auth", false); + + assertEquals("auth", result.getFirst("Authorization")); + assertEquals(MediaType.APPLICATION_JSON.toString(), result.getFirst("Accept")); + assertFalse(result.containsKey("Content-Type")); } @Test |