diff options
author | 2017-09-08 13:27:46 -0400 | |
---|---|---|
committer | 2017-09-08 13:32:24 -0400 | |
commit | 62cd6aaaf74aa91ee0037c0e155c8e7284f07567 (patch) | |
tree | 68c0c53c9156f5aa3c6b3599ac940770f986633d /common/src/test/java/org/openecomp/mso/logger/LogFilterESTest.java | |
parent | fa1a211d28a912892fcd888569df033900eb01ee (diff) |
1710 Rebase - Second Attempt
This commit rebases changes from openecomp-mso/internal-staging-1710 up to and including this codecloud commit:
54483fc6606ddb1591a2e9da61bff8712325f924
Wed Sep 6 18:12:56 2017 -0400
Rebasing was done on a branch on top of this commit in so/master in ONAP:
93fbdfbe46104f8859d4754040f979cb7997c157
Thu Sep 7 16:42:59 2017 +0000
Change-Id: I4ad9abf40da32bf5bdca43e868b8fa2dbcd9dc59
Issue-id: SO-107
Signed-off-by: Arthur Martella <amartell@research.att.com>
Diffstat (limited to 'common/src/test/java/org/openecomp/mso/logger/LogFilterESTest.java')
-rw-r--r-- | common/src/test/java/org/openecomp/mso/logger/LogFilterESTest.java | 191 |
1 files changed, 0 insertions, 191 deletions
diff --git a/common/src/test/java/org/openecomp/mso/logger/LogFilterESTest.java b/common/src/test/java/org/openecomp/mso/logger/LogFilterESTest.java deleted file mode 100644 index 22936857c6..0000000000 --- a/common/src/test/java/org/openecomp/mso/logger/LogFilterESTest.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * This file was automatically generated by EvoSuite - * Mon Nov 14 09:08:24 GMT 2016 - */ - -package org.openecomp.mso.logger; - -import org.junit.Test; -import static org.junit.Assert.*; -import static org.evosuite.shaded.org.mockito.Mockito.*; -import static org.evosuite.runtime.MockitoExtension.*; -import static org.evosuite.runtime.EvoAssertions.*; - -import java.security.Principal; -import javax.servlet.AsyncContext; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.ServletResponseWrapper; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; -import org.evosuite.runtime.EvoRunner; -import org.evosuite.runtime.EvoRunnerParameters; -import org.evosuite.runtime.ViolatedAssumptionAnswer; -import org.junit.runner.RunWith; - -@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) -public class LogFilterESTest extends LogFilterESTestscaffolding { - - @Test(timeout = 4000) - public void test0() throws Throwable { - LogFilter logFilter0 = new LogFilter(); - FilterChain filterChain0 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - // Undeclared exception! - try { - logFilter0.doFilter((ServletRequest) null, (ServletResponse) null, filterChain0); - fail("Expecting exception: NullPointerException"); - - } catch(NullPointerException e) { - // - // no message in exception (getMessage() returned null) - // - verifyException("org.openecomp.mso.logger.LogFilter", e); - } - } - - @Test(timeout = 4000) - public void test1() throws Throwable { - LogFilter logFilter0 = new LogFilter(); - ServletRequest servletRequest0 = mock(ServletRequest.class, new ViolatedAssumptionAnswer()); - ServletResponse servletResponse0 = mock(ServletResponse.class, new ViolatedAssumptionAnswer()); - FilterChain filterChain0 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - // Undeclared exception! - try { - logFilter0.doFilter(servletRequest0, servletResponse0, filterChain0); - fail("Expecting exception: ClassCastException"); - - } catch(ClassCastException e) { - // - // $javax.servlet.ServletRequest$$EnhancerByMockitoWithCGLIB$$d677bdba cannot be cast to javax.servlet.http.HttpServletRequest - // - verifyException("org.openecomp.mso.logger.LogFilter", e); - } - } - - @Test(timeout = 4000) - public void test2() throws Throwable { - LogFilter logFilter0 = new LogFilter(); - FilterConfig filterConfig0 = mock(FilterConfig.class, new ViolatedAssumptionAnswer()); - logFilter0.init(filterConfig0); - ServletRequest servletRequest0 = mock(ServletRequest.class, new ViolatedAssumptionAnswer()); - ServletResponse servletResponse0 = mock(ServletResponse.class, new ViolatedAssumptionAnswer()); - FilterChain filterChain0 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - // Undeclared exception! - try { - logFilter0.doFilter(servletRequest0, servletResponse0, filterChain0); - fail("Expecting exception: ClassCastException"); - - } catch(ClassCastException e) { - // - // $javax.servlet.ServletRequest$$EnhancerByMockitoWithCGLIB$$d677bdba cannot be cast to javax.servlet.http.HttpServletRequest - // - verifyException("org.openecomp.mso.logger.LogFilter", e); - } - } - - @Test(timeout = 4000) - public void test3() throws Throwable { - LogFilter logFilter0 = new LogFilter(); - FilterConfig filterConfig0 = mock(FilterConfig.class, new ViolatedAssumptionAnswer()); - logFilter0.init(filterConfig0); - ServletRequest servletRequest0 = null; - ServletResponse servletResponse0 = mock(ServletResponse.class, new ViolatedAssumptionAnswer()); - ServletResponse servletResponse1 = mock(ServletResponse.class, new ViolatedAssumptionAnswer()); - FilterChain filterChain0 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - // Undeclared exception! - try { - logFilter0.doFilter((ServletRequest) null, servletResponse1, filterChain0); - fail("Expecting exception: ClassCastException"); - - } catch(ClassCastException e) { - // - // $javax.servlet.ServletResponse$$EnhancerByMockitoWithCGLIB$$b9bd7b44 cannot be cast to javax.servlet.http.HttpServletResponse - // - verifyException("org.openecomp.mso.logger.LogFilter", e); - } - } - - @Test(timeout = 4000) - public void test4() throws Throwable { - LogFilter logFilter0 = new LogFilter(); - logFilter0.destroy(); - HttpServletRequest httpServletRequest0 = mock(HttpServletRequest.class, new ViolatedAssumptionAnswer()); - HttpServletRequestWrapper httpServletRequestWrapper0 = new HttpServletRequestWrapper(httpServletRequest0); - ServletResponse servletResponse0 = null; - ServletResponseWrapper servletResponseWrapper0 = null; - try { - servletResponseWrapper0 = new ServletResponseWrapper((ServletResponse) null); - fail("Expecting exception: IllegalArgumentException"); - - } catch(IllegalArgumentException e) { - // - // Response cannot be null - // - verifyException("javax.servlet.ServletResponseWrapper", e); - } - } - - @Test(timeout = 4000) - public void test5() throws Throwable { - LogFilter logFilter0 = new LogFilter(); - HttpServletRequest httpServletRequest0 = mock(HttpServletRequest.class, new ViolatedAssumptionAnswer()); - doReturn((String) null, (String) null, (String) null, (String) null, (String) null).when(httpServletRequest0).getRemoteAddr(); - doReturn((AsyncContext) null).when(httpServletRequest0).startAsync(any(javax.servlet.ServletRequest.class) , any(javax.servlet.ServletResponse.class)); - doReturn((Principal) null, (Principal) null, (Principal) null, (Principal) null, (Principal) null).when(httpServletRequest0).getUserPrincipal(); - HttpServletRequestWrapper httpServletRequestWrapper0 = new HttpServletRequestWrapper(httpServletRequest0); - ServletRequest servletRequest0 = httpServletRequestWrapper0.getRequest(); - HttpServletResponse httpServletResponse0 = mock(HttpServletResponse.class, new ViolatedAssumptionAnswer()); - doReturn((String) null).when(httpServletResponse0).getCharacterEncoding(); - HttpServletResponseWrapper httpServletResponseWrapper0 = new HttpServletResponseWrapper(httpServletResponse0); - FilterChain filterChain0 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - logFilter0.doFilter(servletRequest0, httpServletResponseWrapper0, filterChain0); - logFilter0.destroy(); - LogFilter logFilter1 = new LogFilter(); - HttpServletResponseWrapper httpServletResponseWrapper1 = new HttpServletResponseWrapper((HttpServletResponse) httpServletResponseWrapper0); - FilterChain filterChain1 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - logFilter0.doFilter(servletRequest0, httpServletResponseWrapper0, filterChain1); - FilterChain filterChain2 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - logFilter1.doFilter(servletRequest0, httpServletResponseWrapper1, filterChain2); - HttpServletResponseWrapper httpServletResponseWrapper2 = (HttpServletResponseWrapper)httpServletResponseWrapper1.getResponse(); - httpServletResponseWrapper1.getCharacterEncoding(); - httpServletResponseWrapper1.flushBuffer(); - httpServletRequestWrapper0.startAsync(servletRequest0, (ServletResponse) httpServletResponseWrapper1); - FilterChain filterChain3 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - logFilter1.doFilter(servletRequest0, httpServletResponseWrapper2, filterChain3); - FilterChain filterChain4 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - FilterChain filterChain5 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - logFilter1.doFilter(httpServletRequestWrapper0, httpServletResponseWrapper1, filterChain5); - logFilter1.doFilter(servletRequest0, httpServletResponseWrapper0, filterChain4); - logFilter0.destroy(); - FilterConfig filterConfig0 = mock(FilterConfig.class, new ViolatedAssumptionAnswer()); - logFilter1.init(filterConfig0); - LogFilter logFilter2 = new LogFilter(); - FilterConfig filterConfig1 = mock(FilterConfig.class, new ViolatedAssumptionAnswer()); - logFilter1.init(filterConfig1); - logFilter0.destroy(); - assertFalse(logFilter0.equals((Object)logFilter1)); - } - - @Test(timeout = 4000) - public void test6() throws Throwable { - LogFilter logFilter0 = new LogFilter(); - Principal principal0 = mock(Principal.class, new ViolatedAssumptionAnswer()); - doReturn((String) null).when(principal0).getName(); - HttpServletRequest httpServletRequest0 = mock(HttpServletRequest.class, new ViolatedAssumptionAnswer()); - doReturn("$PJ-hW?").when(httpServletRequest0).getRemoteAddr(); - doReturn(principal0).when(httpServletRequest0).getUserPrincipal(); - HttpServletRequestWrapper httpServletRequestWrapper0 = new HttpServletRequestWrapper(httpServletRequest0); - ServletRequest servletRequest0 = httpServletRequestWrapper0.getRequest(); - HttpServletResponse httpServletResponse0 = mock(HttpServletResponse.class, new ViolatedAssumptionAnswer()); - HttpServletResponseWrapper httpServletResponseWrapper0 = new HttpServletResponseWrapper(httpServletResponse0); - ServletResponse servletResponse0 = httpServletResponseWrapper0.getResponse(); - FilterChain filterChain0 = mock(FilterChain.class, new ViolatedAssumptionAnswer()); - logFilter0.doFilter(servletRequest0, servletResponse0, filterChain0); - FilterConfig filterConfig0 = mock(FilterConfig.class, new ViolatedAssumptionAnswer()); - logFilter0.init(filterConfig0); - } -} |