diff options
-rw-r--r-- | adaptors/rest-adaptor/rest-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/rest/impl/RequestFactoryTest.java | 32 |
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"); |