From 968d54ca133fa53a3617fae6ff30e3ff06f1805e Mon Sep 17 00:00:00 2001 From: Yuli Shlosberg Date: Thu, 19 Oct 2017 23:39:36 +0300 Subject: add more unit tests remove imports Change-Id: If2274759f929f595e63d71cc70c374268c019947 Issue-Id: SDC-467 Signed-off-by: Yuli Shlosberg (cherry picked from commit b947eb599bfab4599ce1b0c0573b1701c646e429) --- .../java/org/openecomp/sdc/fe/GzipFilterTest.java | 40 ++++++++++++++++++++++ .../openecomp/sdc/fe/client/BackendClientTest.java | 34 ++++++++++++++++++ .../sdc/fe/listen/MyObjectMapperProviderTest.java | 30 ++++++++++++++++ .../sdc/fe/servlets/PortalServletTest.java | 35 +++++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java create mode 100644 catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java create mode 100644 catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java create mode 100644 catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java (limited to 'catalog-fe') diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java new file mode 100644 index 0000000000..b91048dfa1 --- /dev/null +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java @@ -0,0 +1,40 @@ +package org.openecomp.sdc.fe; + +import javax.annotation.Generated; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import org.junit.Test; + + +public class GzipFilterTest { + + private GzipFilter createTestSubject() { + return new GzipFilter(); + } + + + + + @Test + public void testInit() throws Exception { + GzipFilter testSubject; + FilterConfig filterConfig = null; + + // default test + testSubject = createTestSubject(); + testSubject.init(filterConfig); + } + + + @Test + public void testDestroy() throws Exception { + GzipFilter testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.destroy(); + } +} \ No newline at end of file diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java new file mode 100644 index 0000000000..d851899f59 --- /dev/null +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java @@ -0,0 +1,34 @@ +package org.openecomp.sdc.fe.client; + +import java.util.List; + +import javax.annotation.Generated; +import javax.net.ssl.HostnameVerifier; +import javax.ws.rs.container.AsyncResponse; + +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.eclipse.jetty.http.HttpGenerator.ResponseInfo; +import org.junit.Test; +import org.openecomp.sdc.fe.impl.HttpRequestInfo; + + +public class BackendClientTest { + + private BackendClient createTestSubject() { + return new BackendClient("", "", ""); + } + + + @Test + public void testGetHostnameVerifier() throws Exception { + BackendClient testSubject; + HostnameVerifier result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostnameVerifier(); + } + + +} \ No newline at end of file diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java new file mode 100644 index 0000000000..a6885bfe1b --- /dev/null +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java @@ -0,0 +1,30 @@ +package org.openecomp.sdc.fe.listen; + +import javax.annotation.Generated; + +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; + + +public class MyObjectMapperProviderTest { + + private MyObjectMapperProvider createTestSubject() { + return new MyObjectMapperProvider(); + } + + + @Test + public void testGetContext() throws Exception { + MyObjectMapperProvider testSubject; + Class type = null; + ObjectMapper result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getContext(type); + } + + + +} \ No newline at end of file diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java new file mode 100644 index 0000000000..25a7c6962d --- /dev/null +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java @@ -0,0 +1,35 @@ +package org.openecomp.sdc.fe.servlets; + +import java.util.List; + +import javax.annotation.Generated; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.junit.Test; +import org.openecomp.sdc.common.impl.MutableHttpServletRequest; + +import io.netty.handler.codec.http2.Http2FrameReader.Configuration; + + +public class PortalServletTest { + + private PortalServlet createTestSubject() { + return new PortalServlet(); + } + + + @Test + public void testDoGet() throws Exception { + PortalServlet testSubject; + HttpServletRequest request = null; + HttpServletResponse response = null; + + // default test + testSubject = createTestSubject(); + testSubject.doGet(request, response); + } + + + +} \ No newline at end of file -- cgit 1.2.3-korg