summaryrefslogtreecommitdiffstats
path: root/adaptors
diff options
context:
space:
mode:
authorGanesh <ganesh.c@samsung.com>2022-04-22 16:33:54 +0530
committerGanesh <ganesh.c@samsung.com>2022-04-22 16:34:04 +0530
commitba74ddd3f92adda66235846363a093d8211fdda1 (patch)
tree37cfddd94d3b8b904d569fe272552af9fb539a1b /adaptors
parentd586124b71ded10aa677ad28f207edc6a3dc7653 (diff)
restAdaptor unit test cases added
Signed-off-by: Ganesh <ganesh.c@samsung.com> Change-Id: I918cac94debd551601582207e29f819128ba7845 Issue-ID: CCSDK-3476
Diffstat (limited to 'adaptors')
-rw-r--r--adaptors/rest-adaptor/rest-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/rest/impl/RequestFactoryTest.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/adaptors/rest-adaptor/rest-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/rest/impl/RequestFactoryTest.java b/adaptors/rest-adaptor/rest-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/rest/impl/RequestFactoryTest.java
index e5c5ed15e..8b1b23acf 100644
--- a/adaptors/rest-adaptor/rest-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/rest/impl/RequestFactoryTest.java
+++ b/adaptors/rest-adaptor/rest-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/rest/impl/RequestFactoryTest.java
@@ -47,6 +47,38 @@ import static org.junit.Assert.assertTrue;
public class RequestFactoryTest {
@Test
+ public void testGetHttpRequestGet() throws Exception {
+ RequestFactory httpRequest = new RequestFactory();
+ HttpRequestBase get = httpRequest.getHttpRequest("get", "http://test/url.com");
+ assertEquals(get.getMethod(), "GET");
+ assertEquals(get.getURI().toString(), "http://test/url.com");
+ }
+
+ @Test
+ public void testGetHttpRequestPost() throws Exception {
+ RequestFactory httpRequest = new RequestFactory();
+ HttpRequestBase get = httpRequest.getHttpRequest("post", "http://test/url.com");
+ assertEquals(get.getMethod(), "POST");
+ assertEquals(get.getURI().toString(), "http://test/url.com");
+ }
+
+ @Test
+ public void testGetHttpRequestPut() throws Exception {
+ RequestFactory httpRequest = new RequestFactory();
+ HttpRequestBase get = httpRequest.getHttpRequest("put", "http://test/url.com");
+ assertEquals(get.getMethod(), "PUT");
+ assertEquals(get.getURI().toString(), "http://test/url.com");
+ }
+
+ @Test
+ public void testGetHttpRequestDelete() throws Exception {
+ RequestFactory httpRequest = new RequestFactory();
+ HttpRequestBase get = httpRequest.getHttpRequest("delete", "http://test/url.com");
+ assertEquals(get.getMethod(), "DELETE");
+ assertEquals(get.getURI().toString(), "http://test/url.com");
+ }
+
+ @Test
public void testConstructorNoArgument() throws Exception {
RequestFactory httpRequest = new RequestFactory();
HttpRequestBase get = httpRequest.getHttpRequest("get", "http://test/url.com");