diff options
Diffstat (limited to 'bpmn/MSORESTClient/src/test/java/org/openecomp/mso/rest/RESTClientESTest.java')
-rw-r--r-- | bpmn/MSORESTClient/src/test/java/org/openecomp/mso/rest/RESTClientESTest.java | 1068 |
1 files changed, 1068 insertions, 0 deletions
diff --git a/bpmn/MSORESTClient/src/test/java/org/openecomp/mso/rest/RESTClientESTest.java b/bpmn/MSORESTClient/src/test/java/org/openecomp/mso/rest/RESTClientESTest.java new file mode 100644 index 0000000000..1a9e05abd0 --- /dev/null +++ b/bpmn/MSORESTClient/src/test/java/org/openecomp/mso/rest/RESTClientESTest.java @@ -0,0 +1,1068 @@ +/* + * This file was automatically generated by EvoSuite + * Mon Nov 14 11:49:09 GMT 2016 + */ + +package org.openecomp.mso.rest; + +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.io.InputStream; +import java.util.LinkedHashMap; +import java.util.List; +import org.apache.http.Header; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.StatusLine; +import org.apache.http.client.HttpClient; +import org.apache.http.entity.InputStreamEntity; +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 RESTClientESTest extends RESTClientESTestscaffolding { + + @Test(timeout = 4000) + public void test00() throws Throwable { + RESTClient rESTClient0 = new RESTClient("org.apache.http.ParseException"); + HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer()); + doReturn((String) null).when(httpClient0).toString(); + doReturn((HttpResponse) null).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class)); + rESTClient0.setUnitTestClient(httpClient0); + // Undeclared exception! + try { + rESTClient0.patch("<;xR"); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.rest.APIResponse", e); + } + } + + @Test(timeout = 4000) + public void test01() throws Throwable { + RESTConfig rESTConfig0 = mock(RESTConfig.class, new ViolatedAssumptionAnswer()); + doReturn((String) null).when(rESTConfig0).getProxyHost(); + doReturn(0).when(rESTConfig0).getProxyPort(); + doReturn((String) null).when(rESTConfig0).getURL(); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer()); + doReturn((String) null).when(httpClient0).toString(); + rESTClient0.setUnitTestClient(httpClient0); + HttpClient httpClient1 = rESTClient0.getUnitTestClient(); + assertSame(httpClient1, httpClient0); + } + + @Test(timeout = 4000) + public void test02() throws Throwable { + RESTClient rESTClient0 = new RESTClient((String) null, "Jhhlq!Y8o>CaA", (-3767)); + String string0 = rESTClient0.getURL(); + assertNull(string0); + } + + @Test(timeout = 4000) + public void test03() throws Throwable { + RESTConfig rESTConfig0 = new RESTConfig("", "=&http.request_sent=http.request_sent", 783, true); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + String string0 = rESTClient0.getURL(); + assertEquals("", string0); + } + + @Test(timeout = 4000) + public void test04() throws Throwable { + RESTClient rESTClient0 = new RESTClient("http"); + RESTClient rESTClient1 = rESTClient0.setParameter("http", "http"); + LinkedHashMap<String, List<String>> linkedHashMap0 = rESTClient1.getParameters(); + assertEquals(1, linkedHashMap0.size()); + } + + @Test(timeout = 4000) + public void test05() throws Throwable { + RESTClient rESTClient0 = new RESTClient(",%LX:SC+'3!nt"); + RESTClient rESTClient1 = rESTClient0.setHeader(",%LX:SC+'3!nt", ",[o<:aGQK"); + LinkedHashMap<String, List<String>> linkedHashMap0 = rESTClient1.getHeaders(); + assertEquals(1, linkedHashMap0.size()); + } + + @Test(timeout = 4000) + public void test06() throws Throwable { + RESTClient rESTClient0 = new RESTClient(""); + InputStream inputStream0 = mock(InputStream.class, new ViolatedAssumptionAnswer()); + InputStreamEntity inputStreamEntity0 = new InputStreamEntity(inputStream0); + StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer()); + doReturn(0).when(statusLine0).getStatusCode(); + HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer()); + doReturn(inputStreamEntity0, (HttpEntity) null, (HttpEntity) null).when(httpResponse0).getEntity(); + doReturn(statusLine0).when(httpResponse0).getStatusLine(); + HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer()); + doReturn("Q[z^W").when(httpClient0).toString(); + doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class)); + rESTClient0.setUnitTestClient(httpClient0); + HttpClient httpClient1 = mock(HttpClient.class, new ViolatedAssumptionAnswer()); + // Undeclared exception! + try { + rESTClient0.post(); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Entity may not be null + // + verifyException("org.apache.http.util.Args", e); + } + } + + @Test(timeout = 4000) + public void test07() throws Throwable { + RESTClient rESTClient0 = new RESTClient(""); + RESTClient rESTClient1 = rESTClient0.setParameter((String) null, "7%d/ia+s(I~@<PK"); + // Undeclared exception! + try { + rESTClient1.post(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URLEncoder", e); + } + } + + @Test(timeout = 4000) + public void test08() throws Throwable { + RESTConfig rESTConfig0 = mock(RESTConfig.class, new ViolatedAssumptionAnswer()); + doReturn((String) null).when(rESTConfig0).getProxyHost(); + doReturn(0).when(rESTConfig0).getProxyPort(); + doReturn((String) null).when(rESTConfig0).getURL(); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + // Undeclared exception! + try { + rESTClient0.post(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + } + } + + @Test(timeout = 4000) + public void test09() throws Throwable { + RESTConfig rESTConfig0 = new RESTConfig("UTF-8"); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + RESTClient rESTClient1 = rESTClient0.addParameter((String) null, ""); + // Undeclared exception! + try { + rESTClient1.patch("DELETE"); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URLEncoder", e); + } + } + + @Test(timeout = 4000) + public void test10() throws Throwable { + RESTClient rESTClient0 = new RESTClient("!{usNmLQ_Gt.C_98"); + // Undeclared exception! + try { + rESTClient0.patch("https"); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal character in path at index 1: !{usNmLQ_Gt.C_98 + // + verifyException("java.net.URI", e); + } + } + + @Test(timeout = 4000) + public void test11() throws Throwable { + RESTClient rESTClient0 = new RESTClient(""); + rESTClient0.addParameter("", (String) null); + // Undeclared exception! + try { + rESTClient0.httpPut(""); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URLEncoder", e); + } + } + + @Test(timeout = 4000) + public void test12() throws Throwable { + RESTClient rESTClient0 = new RESTClient("szM4DVVoiAs`]T/", "szM4DVVoiAs`]T/", (-697)); + // Undeclared exception! + try { + rESTClient0.httpPut(""); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal character in path at index 11: szM4DVVoiAs`]T/ + // + verifyException("java.net.URI", e); + } + } + + @Test(timeout = 4000) + public void test13() throws Throwable { + RESTClient rESTClient0 = new RESTClient((String) null); + // Undeclared exception! + try { + rESTClient0.httpPost(" I3^~h5yoFuif"); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + } + } + + @Test(timeout = 4000) + public void test14() throws Throwable { + RESTConfig rESTConfig0 = new RESTConfig("&", false); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + rESTClient0.setHeader((String) null, "/G$0vW$R4vUaL)*tz"); + // Undeclared exception! + try { + rESTClient0.httpPost("/G$0vW$R4vUaL)*tz"); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Header name may not be null + // + verifyException("org.apache.http.util.Args", e); + } + } + + @Test(timeout = 4000) + public void test15() throws Throwable { + RESTClient rESTClient0 = new RESTClient("oO!CF58JhSCm6t"); + rESTClient0.addParameter((String) null, "oO!CF58JhSCm6t"); + // Undeclared exception! + try { + rESTClient0.httpPost(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URLEncoder", e); + } + } + + @Test(timeout = 4000) + public void test16() throws Throwable { + RESTClient rESTClient0 = new RESTClient((String) null, "F(Oy=<SOmNE9", (-1932735280)); + // Undeclared exception! + try { + rESTClient0.httpPost(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + } + } + + @Test(timeout = 4000) + public void test17() throws Throwable { + RESTConfig rESTConfig0 = new RESTConfig("JAl/&Uq6mM8Kf8", false); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + // Undeclared exception! + try { + rESTClient0.httpPost(); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test18() throws Throwable { + RESTClient rESTClient0 = new RESTClient("&8jW\"", "&8jW\"", (-1)); + // Undeclared exception! + try { + rESTClient0.httpPost(); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal character in path at index 0: &8jW\" + // + verifyException("java.net.URI", e); + } + } + + @Test(timeout = 4000) + public void test19() throws Throwable { + RESTClient rESTClient0 = new RESTClient(")7l9={q>0E4sV]T"); + RESTClient rESTClient1 = rESTClient0.addParameter((String) null, ")7l9={q>0E4sV]T"); + // Undeclared exception! + try { + rESTClient1.httpPatch((String) null); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URLEncoder", e); + } + } + + @Test(timeout = 4000) + public void test20() throws Throwable { + RESTClient rESTClient0 = new RESTClient("[59t(J)"); + // Undeclared exception! + try { + rESTClient0.httpPatch("[59t(J)"); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal character in path at index 0: [59t(J) + // + verifyException("java.net.URI", e); + } + } + + @Test(timeout = 4000) + public void test21() throws Throwable { + RESTClient rESTClient0 = new RESTClient("A29%23fZqv%7F*%405=%7F%7Frdbt-X%22DB%2FhCrUn", "=", (-1)); + HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer()); + doReturn((String) null).when(httpClient0).toString(); + doReturn((HttpResponse) null).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class)); + rESTClient0.setUnitTestClient(httpClient0); + // Undeclared exception! + try { + rESTClient0.httpGet(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.rest.APIResponse", e); + } + } + + @Test(timeout = 4000) + public void test22() throws Throwable { + RESTClient rESTClient0 = new RESTClient("*;R"); + // Undeclared exception! + try { + rESTClient0.httpGet(); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal character in path at index 0: *;R + // + verifyException("java.net.URI", e); + } + } + + @Test(timeout = 4000) + public void test23() throws Throwable { + RESTClient rESTClient0 = new RESTClient("compatibility"); + RESTClient rESTClient1 = rESTClient0.addParameter("https", "https"); + RESTClient rESTClient2 = rESTClient1.setHeader("compatibility", "https"); + RESTClient rESTClient3 = rESTClient2.setParameter("4#'mD<\"jNh?>_vfI:]", "Char array buffer"); + InputStream inputStream0 = mock(InputStream.class, new ViolatedAssumptionAnswer()); + InputStreamEntity inputStreamEntity0 = new InputStreamEntity(inputStream0); + StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer()); + doReturn(0).when(statusLine0).getStatusCode(); + rESTClient3.addHeader("2b?N", "https"); + HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer()); + doReturn(inputStreamEntity0, (HttpEntity) null, (HttpEntity) null).when(httpResponse0).getEntity(); + doReturn(statusLine0).when(httpResponse0).getStatusLine(); + HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer()); + doReturn("GiQ=eHBwH9zA4COa").when(httpClient0).toString(); + doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class)); + rESTClient2.setUnitTestClient(httpClient0); + // Undeclared exception! + try { + rESTClient3.httpDelete(""); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Entity may not be null + // + verifyException("org.apache.http.util.Args", e); + } + } + + @Test(timeout = 4000) + public void test24() throws Throwable { + RESTClient rESTClient0 = new RESTClient(")TZ;T]b%B[FkT4", "%y@{Wz}c3J-!m", 1772); + RESTClient rESTClient1 = rESTClient0.addParameter("$y*O^k0", (String) null); + // Undeclared exception! + try { + rESTClient1.httpDelete((String) null); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URLEncoder", e); + } + } + + @Test(timeout = 4000) + public void test25() throws Throwable { + RESTClient rESTClient0 = new RESTClient("Length Required"); + // Undeclared exception! + try { + rESTClient0.httpDelete("Length Required"); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal character in path at index 6: Length Required + // + verifyException("java.net.URI", e); + } + } + + @Test(timeout = 4000) + public void test26() throws Throwable { + RESTConfig rESTConfig0 = new RESTConfig("yhPl=c#;<s`V", false); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + rESTClient0.addParameter("yhPl=c#;<s`V", (String) null); + // Undeclared exception! + try { + rESTClient0.httpDelete(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URLEncoder", e); + } + } + + @Test(timeout = 4000) + public void test27() throws Throwable { + RESTConfig rESTConfig0 = new RESTConfig("2cSq'/FF]W'K.S^k=<=", "2cSq'/FF]W'K.S^k=<=", 2605); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + // Undeclared exception! + try { + rESTClient0.httpDelete(); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal character in path at index 8: 2cSq'/FF]W'K.S^k=<= + // + verifyException("java.net.URI", e); + } + } + + @Test(timeout = 4000) + public void test28() throws Throwable { + RESTClient rESTClient0 = new RESTClient(")7l9={q>0E4sV]T"); + RESTClient rESTClient1 = rESTClient0.addParameter((String) null, ")7l9={q>0E4sV]T"); + // Undeclared exception! + try { + rESTClient1.get(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URLEncoder", e); + } + } + + @Test(timeout = 4000) + public void test29() throws Throwable { + RESTClient rESTClient0 = new RESTClient("z8UR?=)5pTtS]*"); + // Undeclared exception! + try { + rESTClient0.get(); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test30() throws Throwable { + RESTClient rESTClient0 = new RESTClient("JB<TRwDR@k.-C$=w3", "|N", 0); + // Undeclared exception! + try { + rESTClient0.get(); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal character in path at index 2: JB<TRwDR@k.-C$=w3 + // + verifyException("java.net.URI", e); + } + } + + @Test(timeout = 4000) + public void test31() throws Throwable { + RESTClient rESTClient0 = new RESTClient("YoeLljo%3A%5C%3D=http", "http.protocol.element-charset", (-1908874351)); + RESTClient rESTClient1 = rESTClient0.setParameter("I/O exception (", (String) null); + // Undeclared exception! + try { + rESTClient1.delete(); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("java.net.URLEncoder", e); + } + } + + @Test(timeout = 4000) + public void test32() throws Throwable { + RESTClient rESTClient0 = new RESTClient("\":VYxeR;PP]jO_[f'"); + // Undeclared exception! + try { + rESTClient0.delete(); + fail("Expecting exception: IllegalArgumentException"); + + } catch(IllegalArgumentException e) { + // + // Illegal character in scheme name at index 0: \":VYxeR;PP]jO_[f' + // + verifyException("java.net.URI", e); + } + } + + @Test(timeout = 4000) + public void test33() throws Throwable { + RESTClient rESTClient0 = null; + try { + rESTClient0 = new RESTClient((RESTConfig) null); + fail("Expecting exception: NullPointerException"); + + } catch(NullPointerException e) { + // + // no message in exception (getMessage() returned null) + // + verifyException("org.openecomp.mso.rest.RESTClient", e); + } + } + + @Test(timeout = 4000) + public void test34() throws Throwable { + RESTClient rESTClient0 = new RESTClient(""); + rESTClient0.addParameter("", ""); + // Undeclared exception! + try { + rESTClient0.httpPatch("lr"); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test35() throws Throwable { + RESTClient rESTClient0 = new RESTClient("", "netscape", 1); + // Undeclared exception! + try { + rESTClient0.httpPost(""); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test36() throws Throwable { + RESTConfig rESTConfig0 = new RESTConfig((String) null); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + // Undeclared exception! + try { + rESTClient0.httpGet(); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test37() throws Throwable { + RESTClient rESTClient0 = new RESTClient("K.7:dc=", "K.7:dc=", 0); + try { + rESTClient0.httpPost(); + fail("Expecting exception: Exception"); + + } catch(Exception e) { + // + // org.evosuite.runtime.mock.java.lang.MockThrowable: URI does not specify a valid host name: K.7:dc= + // + verifyException("org.openecomp.mso.rest.RESTClient", e); + } + } + + @Test(timeout = 4000) + public void test38() throws Throwable { + RESTClient rESTClient0 = new RESTClient("org.apache.http.ParseException=", "EWh2BZ[]:q+%4S#7K", (-1847)); + // Undeclared exception! + try { + rESTClient0.httpDelete(); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test39() throws Throwable { + RESTClient rESTClient0 = new RESTClient(",%LX:SC+'3!nt"); + String string0 = rESTClient0.getURL(); + assertEquals(",%LX:SC+'3!nt", string0); + } + + @Test(timeout = 4000) + public void test40() throws Throwable { + RESTClient rESTClient0 = new RESTClient("compatibility"); + InputStream inputStream0 = mock(InputStream.class, new ViolatedAssumptionAnswer()); + doReturn((-3113)).when(inputStream0).read(any(byte[].class)); + HttpEntity httpEntity0 = mock(HttpEntity.class, new ViolatedAssumptionAnswer()); + StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer()); + doReturn(201).when(statusLine0).getStatusCode(); + HttpEntity httpEntity1 = mock(HttpEntity.class, new ViolatedAssumptionAnswer()); + doReturn(inputStream0).when(httpEntity1).getContent(); + doReturn(0L, (long)(-2116360694)).when(httpEntity1).getContentLength(); + HttpEntity httpEntity2 = mock(HttpEntity.class, new ViolatedAssumptionAnswer()); + doReturn(false).when(httpEntity2).isStreaming(); + HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer()); + doReturn(httpEntity0, httpEntity1, httpEntity2).when(httpResponse0).getEntity(); + doReturn(statusLine0).when(httpResponse0).getStatusLine(); + HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer()); + doReturn("GiQ=eHBwH9zA4COa").when(httpClient0).toString(); + doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class)); + rESTClient0.setUnitTestClient(httpClient0); + // Undeclared exception! + try { + rESTClient0.httpDelete(""); + fail("Expecting exception: IndexOutOfBoundsException"); + + } catch(IndexOutOfBoundsException e) { + // + // off: 0 len: -3113 b.length: 4096 + // + verifyException("org.apache.http.util.ByteArrayBuffer", e); + } + } + + @Test(timeout = 4000) + public void test41() throws Throwable { + RESTClient rESTClient0 = new RESTClient("compatibility"); + HttpEntity httpEntity0 = mock(HttpEntity.class, new ViolatedAssumptionAnswer()); + StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer()); + doReturn(201).when(statusLine0).getStatusCode(); + Header[] headerArray0 = new Header[0]; + HttpEntity httpEntity1 = mock(HttpEntity.class, new ViolatedAssumptionAnswer()); + doReturn((InputStream) null).when(httpEntity1).getContent(); + HttpEntity httpEntity2 = mock(HttpEntity.class, new ViolatedAssumptionAnswer()); + doReturn(false).when(httpEntity2).isStreaming(); + HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer()); + doReturn(headerArray0).when(httpResponse0).getAllHeaders(); + doReturn(httpEntity0, httpEntity1, httpEntity2).when(httpResponse0).getEntity(); + doReturn(statusLine0).when(httpResponse0).getStatusLine(); + HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer()); + doReturn("GiQ=eHBwH9zA4COa").when(httpClient0).toString(); + doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class)); + rESTClient0.setUnitTestClient(httpClient0); + APIResponse aPIResponse0 = rESTClient0.httpDelete(""); + assertEquals(201, aPIResponse0.getStatusCode()); + } + + @Test(timeout = 4000) + public void test42() throws Throwable { + RESTClient rESTClient0 = new RESTClient("wlq:6r"); + try { + rESTClient0.httpDelete("E"); + fail("Expecting exception: Exception"); + + } catch(Exception e) { + // + // org.evosuite.runtime.mock.java.lang.MockThrowable: URI does not specify a valid host name: wlq:6r + // + verifyException("org.openecomp.mso.rest.RESTClient", e); + } + } + + @Test(timeout = 4000) + public void test43() throws Throwable { + RESTClient rESTClient0 = new RESTClient(""); + // Undeclared exception! + try { + rESTClient0.httpPatch(""); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test44() throws Throwable { + RESTClient rESTClient0 = new RESTClient("DELETE"); + // Undeclared exception! + try { + rESTClient0.httpPatch((String) null); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test45() throws Throwable { + RESTClient rESTClient0 = new RESTClient("org.apache.http.ParseException"); + RESTClient rESTClient1 = rESTClient0.addParameter("DELETE", ""); + // Undeclared exception! + try { + rESTClient1.patch("<;xR"); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test46() throws Throwable { + RESTClient rESTClient0 = new RESTClient("compatibility"); + HttpEntity httpEntity0 = mock(HttpEntity.class, new ViolatedAssumptionAnswer()); + StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer()); + doReturn(201).when(statusLine0).getStatusCode(); + Header[] headerArray0 = new Header[0]; + HttpEntity httpEntity1 = mock(HttpEntity.class, new ViolatedAssumptionAnswer()); + doReturn((InputStream) null).when(httpEntity1).getContent(); + HttpEntity httpEntity2 = mock(HttpEntity.class, new ViolatedAssumptionAnswer()); + doReturn(false).when(httpEntity2).isStreaming(); + HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer()); + doReturn(headerArray0).when(httpResponse0).getAllHeaders(); + doReturn(httpEntity0, httpEntity1, httpEntity2).when(httpResponse0).getEntity(); + doReturn(statusLine0).when(httpResponse0).getStatusLine(); + HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer()); + doReturn("GiQ=eHBwH9zA4COa").when(httpClient0).toString(); + doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class)); + rESTClient0.setUnitTestClient(httpClient0); + APIResponse aPIResponse0 = rESTClient0.httpPut("compatibility"); + assertEquals(201, aPIResponse0.getStatusCode()); + } + + @Test(timeout = 4000) + public void test47() throws Throwable { + RESTClient rESTClient0 = new RESTClient(""); + // Undeclared exception! + try { + rESTClient0.httpPut(""); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test48() throws Throwable { + RESTClient rESTClient0 = new RESTClient("compatibility"); + rESTClient0.addParameter("https", "https"); + // Undeclared exception! + try { + rESTClient0.httpPut("compatibility"); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test49() throws Throwable { + RESTClient rESTClient0 = new RESTClient("", "(", 307); + // Undeclared exception! + try { + rESTClient0.httpPut((String) null); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test50() throws Throwable { + RESTClient rESTClient0 = new RESTClient("@0*Eu-=Fa"); + // Undeclared exception! + try { + rESTClient0.httpPost("@0*Eu-=Fa"); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test51() throws Throwable { + RESTClient rESTClient0 = new RESTClient("x"); + // Undeclared exception! + try { + rESTClient0.httpPost((String) null); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test52() throws Throwable { + RESTConfig rESTConfig0 = new RESTConfig("2cSq'/FF]W'K.S^k=<=", "2cSq'/FF]W'K.S^k=<=", 2605); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + RESTClient rESTClient1 = rESTClient0.setHeader("WkI<", "http"); + RESTClient rESTClient2 = rESTClient1.setHeader("WkI<", ""); + assertEquals("2cSq'/FF]W'K.S^k=<=", rESTClient2.getURL()); + } + + @Test(timeout = 4000) + public void test53() throws Throwable { + RESTClient rESTClient0 = new RESTClient("szM4DVVoiAs`]T/", "szM4DVVoiAs`]T/", (-697)); + RESTClient rESTClient1 = rESTClient0.setHeader("szM4DVVoiAs`]T/", "szM4DVVoiAs`]T/"); + RESTClient rESTClient2 = rESTClient1.addHeader("szM4DVVoiAs`]T/", "szM4DVVoiAs`]T/"); + assertSame(rESTClient0, rESTClient2); + } + + @Test(timeout = 4000) + public void test54() throws Throwable { + RESTClient rESTClient0 = new RESTClient("E U(~h|zVLWi", "http", 0); + rESTClient0.setParameter("E U(~h|zVLWi", "http"); + RESTClient rESTClient1 = rESTClient0.setParameter("E U(~h|zVLWi", "k@(}4U05'$}yl)W"); + assertSame(rESTClient1, rESTClient0); + } + + @Test(timeout = 4000) + public void test55() throws Throwable { + RESTClient rESTClient0 = new RESTClient(""); + RESTClient rESTClient1 = rESTClient0.addParameter("", ""); + RESTClient rESTClient2 = rESTClient0.addParameter("", (String) null); + assertSame(rESTClient2, rESTClient1); + } + + @Test(timeout = 4000) + public void test56() throws Throwable { + RESTClient rESTClient0 = new RESTClient("compatibility"); + rESTClient0.addParameter("https", "https"); + RESTClient rESTClient1 = rESTClient0.setParameter("4#'mD<\"jNh?>_vfI:]", "Char array buffer"); + // Undeclared exception! + try { + rESTClient1.httpDelete(""); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test57() throws Throwable { + RESTClient rESTClient0 = new RESTClient("K.7:dc="); + try { + rESTClient0.get(); + fail("Expecting exception: Exception"); + + } catch(Exception e) { + // + // org.evosuite.runtime.mock.java.lang.MockThrowable: URI does not specify a valid host name: K.7:dc= + // + verifyException("org.openecomp.mso.rest.RESTClient", e); + } + } + + @Test(timeout = 4000) + public void test58() throws Throwable { + RESTClient rESTClient0 = new RESTClient("http.virtual-host"); + RESTClient rESTClient1 = rESTClient0.addAuthorizationHeader("EWh2BZ[]:q+%4S#7K"); + assertSame(rESTClient0, rESTClient1); + } + + @Test(timeout = 4000) + public void test59() throws Throwable { + RESTClient rESTClient0 = new RESTClient("YoeLljo%3A%5C%3D=http", "http.protocol.element-charset", (-1908874351)); + // Undeclared exception! + try { + rESTClient0.delete(); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test60() throws Throwable { + RESTConfig rESTConfig0 = new RESTConfig("UTF-8"); + RESTClient rESTClient0 = new RESTClient(rESTConfig0); + HttpEntity httpEntity0 = rESTClient0.getHttpEntity(); + assertNull(httpEntity0); + } + + @Test(timeout = 4000) + public void test61() throws Throwable { + RESTClient rESTClient0 = new RESTClient(",%LX:SC+'3!nt"); + LinkedHashMap<String, List<String>> linkedHashMap0 = rESTClient0.getHeaders(); + assertEquals(0, linkedHashMap0.size()); + } + + @Test(timeout = 4000) + public void test62() throws Throwable { + RESTClient rESTClient0 = new RESTClient("DELETE"); + HttpClient httpClient0 = rESTClient0.getUnitTestClient(); + assertNull(httpClient0); + } + + @Test(timeout = 4000) + public void test63() throws Throwable { + RESTClient rESTClient0 = new RESTClient("A29%23fZqv%7F*%405=%7F%7Frdbt-X%22DB%2FhCrUn", "=", (-1)); + RESTClient rESTClient1 = rESTClient0.addParameter("o", "o"); + // Undeclared exception! + try { + rESTClient1.httpGet(); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test64() throws Throwable { + RESTClient rESTClient0 = new RESTClient("DELETE"); + LinkedHashMap<String, List<String>> linkedHashMap0 = rESTClient0.getParameters(); + assertTrue(linkedHashMap0.isEmpty()); + } + + @Test(timeout = 4000) + public void test65() throws Throwable { + RESTClient rESTClient0 = new RESTClient(""); + // Undeclared exception! + try { + rESTClient0.post(); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } + + @Test(timeout = 4000) + public void test66() throws Throwable { + RESTClient rESTClient0 = new RESTClient("DELETE"); + // Undeclared exception! + try { + rESTClient0.httpDelete((String) null); + fail("Expecting exception: IllegalStateException"); + + } catch(IllegalStateException e) { + // + // Target host is null + // + verifyException("org.apache.http.util.Asserts", e); + } + } +} |