2 * This file was automatically generated by EvoSuite
3 * Mon Nov 14 11:49:09 GMT 2016
6 package org.openecomp.mso.rest;
9 import static org.junit.Assert.*;
10 import static org.evosuite.shaded.org.mockito.Mockito.*;
11 import static org.evosuite.runtime.MockitoExtension.*;
12 import static org.evosuite.runtime.EvoAssertions.*;
14 import java.io.InputStream;
15 import java.util.LinkedHashMap;
16 import java.util.List;
17 import org.apache.http.Header;
18 import org.apache.http.HttpEntity;
19 import org.apache.http.HttpResponse;
20 import org.apache.http.StatusLine;
21 import org.apache.http.client.HttpClient;
22 import org.apache.http.entity.InputStreamEntity;
23 import org.evosuite.runtime.EvoRunner;
24 import org.evosuite.runtime.EvoRunnerParameters;
25 import org.evosuite.runtime.ViolatedAssumptionAnswer;
26 import org.junit.runner.RunWith;
28 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
29 public class RESTClientESTest extends RESTClientESTestscaffolding {
32 public void test00() throws Throwable {
33 RESTClient rESTClient0 = new RESTClient("org.apache.http.ParseException");
34 HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer());
35 doReturn((String) null).when(httpClient0).toString();
36 doReturn((HttpResponse) null).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class));
37 rESTClient0.setUnitTestClient(httpClient0);
38 // Undeclared exception!
40 rESTClient0.patch("<;xR");
41 fail("Expecting exception: NullPointerException");
43 } catch(NullPointerException e) {
45 // no message in exception (getMessage() returned null)
47 verifyException("org.openecomp.mso.rest.APIResponse", e);
52 public void test01() throws Throwable {
53 RESTConfig rESTConfig0 = mock(RESTConfig.class, new ViolatedAssumptionAnswer());
54 doReturn((String) null).when(rESTConfig0).getProxyHost();
55 doReturn(0).when(rESTConfig0).getProxyPort();
56 doReturn((String) null).when(rESTConfig0).getURL();
57 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
58 HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer());
59 doReturn((String) null).when(httpClient0).toString();
60 rESTClient0.setUnitTestClient(httpClient0);
61 HttpClient httpClient1 = rESTClient0.getUnitTestClient();
62 assertSame(httpClient1, httpClient0);
66 public void test02() throws Throwable {
67 RESTClient rESTClient0 = new RESTClient((String) null, "Jhhlq!Y8o>CaA", (-3767));
68 String string0 = rESTClient0.getURL();
73 public void test03() throws Throwable {
74 RESTConfig rESTConfig0 = new RESTConfig("", "=&http.request_sent=http.request_sent", 783, true);
75 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
76 String string0 = rESTClient0.getURL();
77 assertEquals("", string0);
81 public void test04() throws Throwable {
82 RESTClient rESTClient0 = new RESTClient("http");
83 RESTClient rESTClient1 = rESTClient0.setParameter("http", "http");
84 LinkedHashMap<String, List<String>> linkedHashMap0 = rESTClient1.getParameters();
85 assertEquals(1, linkedHashMap0.size());
89 public void test05() throws Throwable {
90 RESTClient rESTClient0 = new RESTClient(",%LX:SC+'3!nt");
91 RESTClient rESTClient1 = rESTClient0.setHeader(",%LX:SC+'3!nt", ",[o<:aGQK");
92 LinkedHashMap<String, List<String>> linkedHashMap0 = rESTClient1.getHeaders();
93 assertEquals(1, linkedHashMap0.size());
97 public void test06() throws Throwable {
98 RESTClient rESTClient0 = new RESTClient("");
99 InputStream inputStream0 = mock(InputStream.class, new ViolatedAssumptionAnswer());
100 InputStreamEntity inputStreamEntity0 = new InputStreamEntity(inputStream0);
101 StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer());
102 doReturn(0).when(statusLine0).getStatusCode();
103 HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer());
104 doReturn(inputStreamEntity0, (HttpEntity) null, (HttpEntity) null).when(httpResponse0).getEntity();
105 doReturn(statusLine0).when(httpResponse0).getStatusLine();
106 HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer());
107 doReturn("Q[z^W").when(httpClient0).toString();
108 doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class));
109 rESTClient0.setUnitTestClient(httpClient0);
110 HttpClient httpClient1 = mock(HttpClient.class, new ViolatedAssumptionAnswer());
111 // Undeclared exception!
114 fail("Expecting exception: IllegalArgumentException");
116 } catch(IllegalArgumentException e) {
118 // Entity may not be null
120 verifyException("org.apache.http.util.Args", e);
124 @Test(timeout = 4000)
125 public void test07() throws Throwable {
126 RESTClient rESTClient0 = new RESTClient("");
127 RESTClient rESTClient1 = rESTClient0.setParameter((String) null, "7%d/ia+s(I~@<PK");
128 // Undeclared exception!
131 fail("Expecting exception: NullPointerException");
133 } catch(NullPointerException e) {
135 // no message in exception (getMessage() returned null)
137 verifyException("java.net.URLEncoder", e);
141 @Test(timeout = 4000)
142 public void test08() throws Throwable {
143 RESTConfig rESTConfig0 = mock(RESTConfig.class, new ViolatedAssumptionAnswer());
144 doReturn((String) null).when(rESTConfig0).getProxyHost();
145 doReturn(0).when(rESTConfig0).getProxyPort();
146 doReturn((String) null).when(rESTConfig0).getURL();
147 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
148 // Undeclared exception!
151 fail("Expecting exception: NullPointerException");
153 } catch(NullPointerException e) {
155 // no message in exception (getMessage() returned null)
160 @Test(timeout = 4000)
161 public void test09() throws Throwable {
162 RESTConfig rESTConfig0 = new RESTConfig("UTF-8");
163 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
164 RESTClient rESTClient1 = rESTClient0.addParameter((String) null, "");
165 // Undeclared exception!
167 rESTClient1.patch("DELETE");
168 fail("Expecting exception: NullPointerException");
170 } catch(NullPointerException e) {
172 // no message in exception (getMessage() returned null)
174 verifyException("java.net.URLEncoder", e);
178 @Test(timeout = 4000)
179 public void test10() throws Throwable {
180 RESTClient rESTClient0 = new RESTClient("!{usNmLQ_Gt.C_98");
181 // Undeclared exception!
183 rESTClient0.patch("https");
184 fail("Expecting exception: IllegalArgumentException");
186 } catch(IllegalArgumentException e) {
188 // Illegal character in path at index 1: !{usNmLQ_Gt.C_98
190 verifyException("java.net.URI", e);
194 @Test(timeout = 4000)
195 public void test11() throws Throwable {
196 RESTClient rESTClient0 = new RESTClient("");
197 rESTClient0.addParameter("", (String) null);
198 // Undeclared exception!
200 rESTClient0.httpPut("");
201 fail("Expecting exception: NullPointerException");
203 } catch(NullPointerException e) {
205 // no message in exception (getMessage() returned null)
207 verifyException("java.net.URLEncoder", e);
211 @Test(timeout = 4000)
212 public void test12() throws Throwable {
213 RESTClient rESTClient0 = new RESTClient("szM4DVVoiAs`]T/", "szM4DVVoiAs`]T/", (-697));
214 // Undeclared exception!
216 rESTClient0.httpPut("");
217 fail("Expecting exception: IllegalArgumentException");
219 } catch(IllegalArgumentException e) {
221 // Illegal character in path at index 11: szM4DVVoiAs`]T/
223 verifyException("java.net.URI", e);
227 @Test(timeout = 4000)
228 public void test13() throws Throwable {
229 RESTClient rESTClient0 = new RESTClient((String) null);
230 // Undeclared exception!
232 rESTClient0.httpPost(" I3^~h5yoFuif");
233 fail("Expecting exception: NullPointerException");
235 } catch(NullPointerException e) {
237 // no message in exception (getMessage() returned null)
242 @Test(timeout = 4000)
243 public void test14() throws Throwable {
244 RESTConfig rESTConfig0 = new RESTConfig("&", false);
245 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
246 rESTClient0.setHeader((String) null, "/G$0vW$R4vUaL)*tz");
247 // Undeclared exception!
249 rESTClient0.httpPost("/G$0vW$R4vUaL)*tz");
250 fail("Expecting exception: IllegalArgumentException");
252 } catch(IllegalArgumentException e) {
254 // Header name may not be null
256 verifyException("org.apache.http.util.Args", e);
260 @Test(timeout = 4000)
261 public void test15() throws Throwable {
262 RESTClient rESTClient0 = new RESTClient("oO!CF58JhSCm6t");
263 rESTClient0.addParameter((String) null, "oO!CF58JhSCm6t");
264 // Undeclared exception!
266 rESTClient0.httpPost();
267 fail("Expecting exception: NullPointerException");
269 } catch(NullPointerException e) {
271 // no message in exception (getMessage() returned null)
273 verifyException("java.net.URLEncoder", e);
277 @Test(timeout = 4000)
278 public void test16() throws Throwable {
279 RESTClient rESTClient0 = new RESTClient((String) null, "F(Oy=<SOmNE9", (-1932735280));
280 // Undeclared exception!
282 rESTClient0.httpPost();
283 fail("Expecting exception: NullPointerException");
285 } catch(NullPointerException e) {
287 // no message in exception (getMessage() returned null)
292 @Test(timeout = 4000)
293 public void test17() throws Throwable {
294 RESTConfig rESTConfig0 = new RESTConfig("JAl/&Uq6mM8Kf8", false);
295 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
296 // Undeclared exception!
298 rESTClient0.httpPost();
299 fail("Expecting exception: IllegalStateException");
301 } catch(IllegalStateException e) {
303 // Target host is null
305 verifyException("org.apache.http.util.Asserts", e);
309 @Test(timeout = 4000)
310 public void test18() throws Throwable {
311 RESTClient rESTClient0 = new RESTClient("
\7f&8
\7fjW\"", "
\7f&8
\7fjW\"", (-1));
312 // Undeclared exception!
314 rESTClient0.httpPost();
315 fail("Expecting exception: IllegalArgumentException");
317 } catch(IllegalArgumentException e) {
319 // Illegal character in path at index 0:
\7f&8
\7fjW\"
321 verifyException("java.net.URI", e);
325 @Test(timeout = 4000)
326 public void test19() throws Throwable {
327 RESTClient rESTClient0 = new RESTClient(")7l9={q>0E4sV]T");
328 RESTClient rESTClient1 = rESTClient0.addParameter((String) null, ")7l9={q>0E4sV]T");
329 // Undeclared exception!
331 rESTClient1.httpPatch((String) null);
332 fail("Expecting exception: NullPointerException");
334 } catch(NullPointerException e) {
336 // no message in exception (getMessage() returned null)
338 verifyException("java.net.URLEncoder", e);
342 @Test(timeout = 4000)
343 public void test20() throws Throwable {
344 RESTClient rESTClient0 = new RESTClient("[59t(J)");
345 // Undeclared exception!
347 rESTClient0.httpPatch("[59t(J)");
348 fail("Expecting exception: IllegalArgumentException");
350 } catch(IllegalArgumentException e) {
352 // Illegal character in path at index 0: [59t(J)
354 verifyException("java.net.URI", e);
358 @Test(timeout = 4000)
359 public void test21() throws Throwable {
360 RESTClient rESTClient0 = new RESTClient("A29%23fZqv%7F*%405=%7F%7Frdbt-X%22DB%2FhCrUn", "=", (-1));
361 HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer());
362 doReturn((String) null).when(httpClient0).toString();
363 doReturn((HttpResponse) null).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class));
364 rESTClient0.setUnitTestClient(httpClient0);
365 // Undeclared exception!
367 rESTClient0.httpGet();
368 fail("Expecting exception: NullPointerException");
370 } catch(NullPointerException e) {
372 // no message in exception (getMessage() returned null)
374 verifyException("org.openecomp.mso.rest.APIResponse", e);
378 @Test(timeout = 4000)
379 public void test22() throws Throwable {
380 RESTClient rESTClient0 = new RESTClient("
\7f*;R");
381 // Undeclared exception!
383 rESTClient0.httpGet();
384 fail("Expecting exception: IllegalArgumentException");
386 } catch(IllegalArgumentException e) {
388 // Illegal character in path at index 0:
\7f*;R
390 verifyException("java.net.URI", e);
394 @Test(timeout = 4000)
395 public void test23() throws Throwable {
396 RESTClient rESTClient0 = new RESTClient("compatibility");
397 RESTClient rESTClient1 = rESTClient0.addParameter("https", "https");
398 RESTClient rESTClient2 = rESTClient1.setHeader("compatibility", "https");
399 RESTClient rESTClient3 = rESTClient2.setParameter("4#'mD<\"jNh?>_vfI:]", "Char array buffer");
400 InputStream inputStream0 = mock(InputStream.class, new ViolatedAssumptionAnswer());
401 InputStreamEntity inputStreamEntity0 = new InputStreamEntity(inputStream0);
402 StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer());
403 doReturn(0).when(statusLine0).getStatusCode();
404 rESTClient3.addHeader("2b?N", "https");
405 HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer());
406 doReturn(inputStreamEntity0, (HttpEntity) null, (HttpEntity) null).when(httpResponse0).getEntity();
407 doReturn(statusLine0).when(httpResponse0).getStatusLine();
408 HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer());
409 doReturn("GiQ=e
\7fHBwH9zA4COa").when(httpClient0).toString();
410 doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class));
411 rESTClient2.setUnitTestClient(httpClient0);
412 // Undeclared exception!
414 rESTClient3.httpDelete("");
415 fail("Expecting exception: IllegalArgumentException");
417 } catch(IllegalArgumentException e) {
419 // Entity may not be null
421 verifyException("org.apache.http.util.Args", e);
425 @Test(timeout = 4000)
426 public void test24() throws Throwable {
427 RESTClient rESTClient0 = new RESTClient(")TZ;T]b%B[FkT4", "%y@{Wz}c3J-!m", 1772);
428 RESTClient rESTClient1 = rESTClient0.addParameter("$y*O^k0", (String) null);
429 // Undeclared exception!
431 rESTClient1.httpDelete((String) null);
432 fail("Expecting exception: NullPointerException");
434 } catch(NullPointerException e) {
436 // no message in exception (getMessage() returned null)
438 verifyException("java.net.URLEncoder", e);
442 @Test(timeout = 4000)
443 public void test25() throws Throwable {
444 RESTClient rESTClient0 = new RESTClient("Length Required");
445 // Undeclared exception!
447 rESTClient0.httpDelete("Length Required");
448 fail("Expecting exception: IllegalArgumentException");
450 } catch(IllegalArgumentException e) {
452 // Illegal character in path at index 6: Length Required
454 verifyException("java.net.URI", e);
458 @Test(timeout = 4000)
459 public void test26() throws Throwable {
460 RESTConfig rESTConfig0 = new RESTConfig("yhPl=c#;<s`V", false);
461 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
462 rESTClient0.addParameter("yhPl=c#;<s`V", (String) null);
463 // Undeclared exception!
465 rESTClient0.httpDelete();
466 fail("Expecting exception: NullPointerException");
468 } catch(NullPointerException e) {
470 // no message in exception (getMessage() returned null)
472 verifyException("java.net.URLEncoder", e);
476 @Test(timeout = 4000)
477 public void test27() throws Throwable {
478 RESTConfig rESTConfig0 = new RESTConfig("2cSq'/FF]W'K.S^k=<=", "2cSq'/FF]W'K.S^k=<=", 2605);
479 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
480 // Undeclared exception!
482 rESTClient0.httpDelete();
483 fail("Expecting exception: IllegalArgumentException");
485 } catch(IllegalArgumentException e) {
487 // Illegal character in path at index 8: 2cSq'/FF]W'K.S^k=<=
489 verifyException("java.net.URI", e);
493 @Test(timeout = 4000)
494 public void test28() throws Throwable {
495 RESTClient rESTClient0 = new RESTClient(")7l9={q>0E4sV]T");
496 RESTClient rESTClient1 = rESTClient0.addParameter((String) null, ")7l9={q>0E4sV]T");
497 // Undeclared exception!
500 fail("Expecting exception: NullPointerException");
502 } catch(NullPointerException e) {
504 // no message in exception (getMessage() returned null)
506 verifyException("java.net.URLEncoder", e);
510 @Test(timeout = 4000)
511 public void test29() throws Throwable {
512 RESTClient rESTClient0 = new RESTClient("z8UR?=)5pTtS]*");
513 // Undeclared exception!
516 fail("Expecting exception: IllegalStateException");
518 } catch(IllegalStateException e) {
520 // Target host is null
522 verifyException("org.apache.http.util.Asserts", e);
526 @Test(timeout = 4000)
527 public void test30() throws Throwable {
528 RESTClient rESTClient0 = new RESTClient("JB<
\7fTRwDR@k.-C$=w3", "|N", 0);
529 // Undeclared exception!
532 fail("Expecting exception: IllegalArgumentException");
534 } catch(IllegalArgumentException e) {
536 // Illegal character in path at index 2: JB<
\7fTRwDR@k.-C$=w3
538 verifyException("java.net.URI", e);
542 @Test(timeout = 4000)
543 public void test31() throws Throwable {
544 RESTClient rESTClient0 = new RESTClient("YoeLljo%3A%5C%3D=http", "http.protocol.element-charset", (-1908874351));
545 RESTClient rESTClient1 = rESTClient0.setParameter("I/O exception (", (String) null);
546 // Undeclared exception!
548 rESTClient1.delete();
549 fail("Expecting exception: NullPointerException");
551 } catch(NullPointerException e) {
553 // no message in exception (getMessage() returned null)
555 verifyException("java.net.URLEncoder", e);
559 @Test(timeout = 4000)
560 public void test32() throws Throwable {
561 RESTClient rESTClient0 = new RESTClient("\":VYxeR;PP]jO_[f'");
562 // Undeclared exception!
564 rESTClient0.delete();
565 fail("Expecting exception: IllegalArgumentException");
567 } catch(IllegalArgumentException e) {
569 // Illegal character in scheme name at index 0: \":VYxeR;PP]jO_[f'
571 verifyException("java.net.URI", e);
575 @Test(timeout = 4000)
576 public void test33() throws Throwable {
577 RESTClient rESTClient0 = null;
579 rESTClient0 = new RESTClient((RESTConfig) null);
580 fail("Expecting exception: NullPointerException");
582 } catch(NullPointerException e) {
584 // no message in exception (getMessage() returned null)
586 verifyException("org.openecomp.mso.rest.RESTClient", e);
590 @Test(timeout = 4000)
591 public void test34() throws Throwable {
592 RESTClient rESTClient0 = new RESTClient("");
593 rESTClient0.addParameter("", "");
594 // Undeclared exception!
596 rESTClient0.httpPatch("lr");
597 fail("Expecting exception: IllegalStateException");
599 } catch(IllegalStateException e) {
601 // Target host is null
603 verifyException("org.apache.http.util.Asserts", e);
607 @Test(timeout = 4000)
608 public void test35() throws Throwable {
609 RESTClient rESTClient0 = new RESTClient("", "netscape", 1);
610 // Undeclared exception!
612 rESTClient0.httpPost("");
613 fail("Expecting exception: IllegalStateException");
615 } catch(IllegalStateException e) {
617 // Target host is null
619 verifyException("org.apache.http.util.Asserts", e);
623 @Test(timeout = 4000)
624 public void test36() throws Throwable {
625 RESTConfig rESTConfig0 = new RESTConfig((String) null);
626 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
627 // Undeclared exception!
629 rESTClient0.httpGet();
630 fail("Expecting exception: IllegalStateException");
632 } catch(IllegalStateException e) {
634 // Target host is null
636 verifyException("org.apache.http.util.Asserts", e);
640 @Test(timeout = 4000)
641 public void test37() throws Throwable {
642 RESTClient rESTClient0 = new RESTClient("K.7:dc=", "K.7:dc=", 0);
644 rESTClient0.httpPost();
645 fail("Expecting exception: Exception");
647 } catch(Exception e) {
649 // org.evosuite.runtime.mock.java.lang.MockThrowable: URI does not specify a valid host name: K.7:dc=
651 verifyException("org.openecomp.mso.rest.RESTClient", e);
655 @Test(timeout = 4000)
656 public void test38() throws Throwable {
657 RESTClient rESTClient0 = new RESTClient("org.apache.http.ParseException=", "EWh2BZ[]:q+%4S#7K", (-1847));
658 // Undeclared exception!
660 rESTClient0.httpDelete();
661 fail("Expecting exception: IllegalStateException");
663 } catch(IllegalStateException e) {
665 // Target host is null
667 verifyException("org.apache.http.util.Asserts", e);
671 @Test(timeout = 4000)
672 public void test39() throws Throwable {
673 RESTClient rESTClient0 = new RESTClient(",%LX:SC+'3!nt");
674 String string0 = rESTClient0.getURL();
675 assertEquals(",%LX:SC+'3!nt", string0);
678 @Test(timeout = 4000)
679 public void test40() throws Throwable {
680 RESTClient rESTClient0 = new RESTClient("compatibility");
681 InputStream inputStream0 = mock(InputStream.class, new ViolatedAssumptionAnswer());
682 doReturn((-3113)).when(inputStream0).read(any(byte[].class));
683 HttpEntity httpEntity0 = mock(HttpEntity.class, new ViolatedAssumptionAnswer());
684 StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer());
685 doReturn(201).when(statusLine0).getStatusCode();
686 HttpEntity httpEntity1 = mock(HttpEntity.class, new ViolatedAssumptionAnswer());
687 doReturn(inputStream0).when(httpEntity1).getContent();
688 doReturn(0L, (long)(-2116360694)).when(httpEntity1).getContentLength();
689 HttpEntity httpEntity2 = mock(HttpEntity.class, new ViolatedAssumptionAnswer());
690 doReturn(false).when(httpEntity2).isStreaming();
691 HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer());
692 doReturn(httpEntity0, httpEntity1, httpEntity2).when(httpResponse0).getEntity();
693 doReturn(statusLine0).when(httpResponse0).getStatusLine();
694 HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer());
695 doReturn("GiQ=e
\7fHBwH9zA4COa").when(httpClient0).toString();
696 doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class));
697 rESTClient0.setUnitTestClient(httpClient0);
698 // Undeclared exception!
700 rESTClient0.httpDelete("");
701 fail("Expecting exception: IndexOutOfBoundsException");
703 } catch(IndexOutOfBoundsException e) {
705 // off: 0 len: -3113 b.length: 4096
707 verifyException("org.apache.http.util.ByteArrayBuffer", e);
711 @Test(timeout = 4000)
712 public void test41() throws Throwable {
713 RESTClient rESTClient0 = new RESTClient("compatibility");
714 HttpEntity httpEntity0 = mock(HttpEntity.class, new ViolatedAssumptionAnswer());
715 StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer());
716 doReturn(201).when(statusLine0).getStatusCode();
717 Header[] headerArray0 = new Header[0];
718 HttpEntity httpEntity1 = mock(HttpEntity.class, new ViolatedAssumptionAnswer());
719 doReturn((InputStream) null).when(httpEntity1).getContent();
720 HttpEntity httpEntity2 = mock(HttpEntity.class, new ViolatedAssumptionAnswer());
721 doReturn(false).when(httpEntity2).isStreaming();
722 HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer());
723 doReturn(headerArray0).when(httpResponse0).getAllHeaders();
724 doReturn(httpEntity0, httpEntity1, httpEntity2).when(httpResponse0).getEntity();
725 doReturn(statusLine0).when(httpResponse0).getStatusLine();
726 HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer());
727 doReturn("GiQ=e
\7fHBwH9zA4COa").when(httpClient0).toString();
728 doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class));
729 rESTClient0.setUnitTestClient(httpClient0);
730 APIResponse aPIResponse0 = rESTClient0.httpDelete("");
731 assertEquals(201, aPIResponse0.getStatusCode());
734 @Test(timeout = 4000)
735 public void test42() throws Throwable {
736 RESTClient rESTClient0 = new RESTClient("wlq:6r");
738 rESTClient0.httpDelete("E");
739 fail("Expecting exception: Exception");
741 } catch(Exception e) {
743 // org.evosuite.runtime.mock.java.lang.MockThrowable: URI does not specify a valid host name: wlq:6r
745 verifyException("org.openecomp.mso.rest.RESTClient", e);
749 @Test(timeout = 4000)
750 public void test43() throws Throwable {
751 RESTClient rESTClient0 = new RESTClient("");
752 // Undeclared exception!
754 rESTClient0.httpPatch("");
755 fail("Expecting exception: IllegalStateException");
757 } catch(IllegalStateException e) {
759 // Target host is null
761 verifyException("org.apache.http.util.Asserts", e);
765 @Test(timeout = 4000)
766 public void test44() throws Throwable {
767 RESTClient rESTClient0 = new RESTClient("DELETE");
768 // Undeclared exception!
770 rESTClient0.httpPatch((String) null);
771 fail("Expecting exception: IllegalStateException");
773 } catch(IllegalStateException e) {
775 // Target host is null
777 verifyException("org.apache.http.util.Asserts", e);
781 @Test(timeout = 4000)
782 public void test45() throws Throwable {
783 RESTClient rESTClient0 = new RESTClient("org.apache.http.ParseException");
784 RESTClient rESTClient1 = rESTClient0.addParameter("DELETE", "");
785 // Undeclared exception!
787 rESTClient1.patch("<;xR");
788 fail("Expecting exception: IllegalStateException");
790 } catch(IllegalStateException e) {
792 // Target host is null
794 verifyException("org.apache.http.util.Asserts", e);
798 @Test(timeout = 4000)
799 public void test46() throws Throwable {
800 RESTClient rESTClient0 = new RESTClient("compatibility");
801 HttpEntity httpEntity0 = mock(HttpEntity.class, new ViolatedAssumptionAnswer());
802 StatusLine statusLine0 = mock(StatusLine.class, new ViolatedAssumptionAnswer());
803 doReturn(201).when(statusLine0).getStatusCode();
804 Header[] headerArray0 = new Header[0];
805 HttpEntity httpEntity1 = mock(HttpEntity.class, new ViolatedAssumptionAnswer());
806 doReturn((InputStream) null).when(httpEntity1).getContent();
807 HttpEntity httpEntity2 = mock(HttpEntity.class, new ViolatedAssumptionAnswer());
808 doReturn(false).when(httpEntity2).isStreaming();
809 HttpResponse httpResponse0 = mock(HttpResponse.class, new ViolatedAssumptionAnswer());
810 doReturn(headerArray0).when(httpResponse0).getAllHeaders();
811 doReturn(httpEntity0, httpEntity1, httpEntity2).when(httpResponse0).getEntity();
812 doReturn(statusLine0).when(httpResponse0).getStatusLine();
813 HttpClient httpClient0 = mock(HttpClient.class, new ViolatedAssumptionAnswer());
814 doReturn("GiQ=e
\7fHBwH9zA4COa").when(httpClient0).toString();
815 doReturn(httpResponse0).when(httpClient0).execute(any(org.apache.http.client.methods.HttpUriRequest.class));
816 rESTClient0.setUnitTestClient(httpClient0);
817 APIResponse aPIResponse0 = rESTClient0.httpPut("compatibility");
818 assertEquals(201, aPIResponse0.getStatusCode());
821 @Test(timeout = 4000)
822 public void test47() throws Throwable {
823 RESTClient rESTClient0 = new RESTClient("");
824 // Undeclared exception!
826 rESTClient0.httpPut("");
827 fail("Expecting exception: IllegalStateException");
829 } catch(IllegalStateException e) {
831 // Target host is null
833 verifyException("org.apache.http.util.Asserts", e);
837 @Test(timeout = 4000)
838 public void test48() throws Throwable {
839 RESTClient rESTClient0 = new RESTClient("compatibility");
840 rESTClient0.addParameter("https", "https");
841 // Undeclared exception!
843 rESTClient0.httpPut("compatibility");
844 fail("Expecting exception: IllegalStateException");
846 } catch(IllegalStateException e) {
848 // Target host is null
850 verifyException("org.apache.http.util.Asserts", e);
854 @Test(timeout = 4000)
855 public void test49() throws Throwable {
856 RESTClient rESTClient0 = new RESTClient("", "(", 307);
857 // Undeclared exception!
859 rESTClient0.httpPut((String) null);
860 fail("Expecting exception: IllegalStateException");
862 } catch(IllegalStateException e) {
864 // Target host is null
866 verifyException("org.apache.http.util.Asserts", e);
870 @Test(timeout = 4000)
871 public void test50() throws Throwable {
872 RESTClient rESTClient0 = new RESTClient("@0*Eu-=Fa");
873 // Undeclared exception!
875 rESTClient0.httpPost("@0*Eu-=Fa");
876 fail("Expecting exception: IllegalStateException");
878 } catch(IllegalStateException e) {
880 // Target host is null
882 verifyException("org.apache.http.util.Asserts", e);
886 @Test(timeout = 4000)
887 public void test51() throws Throwable {
888 RESTClient rESTClient0 = new RESTClient("x");
889 // Undeclared exception!
891 rESTClient0.httpPost((String) null);
892 fail("Expecting exception: IllegalStateException");
894 } catch(IllegalStateException e) {
896 // Target host is null
898 verifyException("org.apache.http.util.Asserts", e);
902 @Test(timeout = 4000)
903 public void test52() throws Throwable {
904 RESTConfig rESTConfig0 = new RESTConfig("2cSq'/FF]W'K.S^k=<=", "2cSq'/FF]W'K.S^k=<=", 2605);
905 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
906 RESTClient rESTClient1 = rESTClient0.setHeader("WkI
\7f<", "http");
907 RESTClient rESTClient2 = rESTClient1.setHeader("WkI
\7f<", "");
908 assertEquals("2cSq'/FF]W'K.S^k=<=", rESTClient2.getURL());
911 @Test(timeout = 4000)
912 public void test53() throws Throwable {
913 RESTClient rESTClient0 = new RESTClient("szM4DVVoiAs`]T/", "szM4DVVoiAs`]T/", (-697));
914 RESTClient rESTClient1 = rESTClient0.setHeader("szM4DVVoiAs`]T/", "szM4DVVoiAs`]T/");
915 RESTClient rESTClient2 = rESTClient1.addHeader("szM4DVVoiAs`]T/", "szM4DVVoiAs`]T/");
916 assertSame(rESTClient0, rESTClient2);
919 @Test(timeout = 4000)
920 public void test54() throws Throwable {
921 RESTClient rESTClient0 = new RESTClient("E U(~h|zVLWi", "http", 0);
922 rESTClient0.setParameter("E U(~h|zVLWi", "http");
923 RESTClient rESTClient1 = rESTClient0.setParameter("E U(~h|zVLWi", "k@(}4U05'$}yl)W");
924 assertSame(rESTClient1, rESTClient0);
927 @Test(timeout = 4000)
928 public void test55() throws Throwable {
929 RESTClient rESTClient0 = new RESTClient("");
930 RESTClient rESTClient1 = rESTClient0.addParameter("", "");
931 RESTClient rESTClient2 = rESTClient0.addParameter("", (String) null);
932 assertSame(rESTClient2, rESTClient1);
935 @Test(timeout = 4000)
936 public void test56() throws Throwable {
937 RESTClient rESTClient0 = new RESTClient("compatibility");
938 rESTClient0.addParameter("https", "https");
939 RESTClient rESTClient1 = rESTClient0.setParameter("4#'mD<\"jNh?>_vfI:]", "Char array buffer");
940 // Undeclared exception!
942 rESTClient1.httpDelete("");
943 fail("Expecting exception: IllegalStateException");
945 } catch(IllegalStateException e) {
947 // Target host is null
949 verifyException("org.apache.http.util.Asserts", e);
953 @Test(timeout = 4000)
954 public void test57() throws Throwable {
955 RESTClient rESTClient0 = new RESTClient("K.7:dc=");
958 fail("Expecting exception: Exception");
960 } catch(Exception e) {
962 // org.evosuite.runtime.mock.java.lang.MockThrowable: URI does not specify a valid host name: K.7:dc=
964 verifyException("org.openecomp.mso.rest.RESTClient", e);
968 @Test(timeout = 4000)
969 public void test58() throws Throwable {
970 RESTClient rESTClient0 = new RESTClient("http.virtual-host");
971 RESTClient rESTClient1 = rESTClient0.addAuthorizationHeader("EWh2BZ[]:q+%4S#7K");
972 assertSame(rESTClient0, rESTClient1);
975 @Test(timeout = 4000)
976 public void test59() throws Throwable {
977 RESTClient rESTClient0 = new RESTClient("YoeLljo%3A%5C%3D=http", "http.protocol.element-charset", (-1908874351));
978 // Undeclared exception!
980 rESTClient0.delete();
981 fail("Expecting exception: IllegalStateException");
983 } catch(IllegalStateException e) {
985 // Target host is null
987 verifyException("org.apache.http.util.Asserts", e);
991 @Test(timeout = 4000)
992 public void test60() throws Throwable {
993 RESTConfig rESTConfig0 = new RESTConfig("UTF-8");
994 RESTClient rESTClient0 = new RESTClient(rESTConfig0);
995 HttpEntity httpEntity0 = rESTClient0.getHttpEntity();
996 assertNull(httpEntity0);
999 @Test(timeout = 4000)
1000 public void test61() throws Throwable {
1001 RESTClient rESTClient0 = new RESTClient(",%LX:SC+'3!nt");
1002 LinkedHashMap<String, List<String>> linkedHashMap0 = rESTClient0.getHeaders();
1003 assertEquals(0, linkedHashMap0.size());
1006 @Test(timeout = 4000)
1007 public void test62() throws Throwable {
1008 RESTClient rESTClient0 = new RESTClient("DELETE");
1009 HttpClient httpClient0 = rESTClient0.getUnitTestClient();
1010 assertNull(httpClient0);
1013 @Test(timeout = 4000)
1014 public void test63() throws Throwable {
1015 RESTClient rESTClient0 = new RESTClient("A29%23fZqv%7F*%405=%7F%7Frdbt-X%22DB%2FhCrUn", "=", (-1));
1016 RESTClient rESTClient1 = rESTClient0.addParameter("o", "o");
1017 // Undeclared exception!
1019 rESTClient1.httpGet();
1020 fail("Expecting exception: IllegalStateException");
1022 } catch(IllegalStateException e) {
1024 // Target host is null
1026 verifyException("org.apache.http.util.Asserts", e);
1030 @Test(timeout = 4000)
1031 public void test64() throws Throwable {
1032 RESTClient rESTClient0 = new RESTClient("DELETE");
1033 LinkedHashMap<String, List<String>> linkedHashMap0 = rESTClient0.getParameters();
1034 assertTrue(linkedHashMap0.isEmpty());
1037 @Test(timeout = 4000)
1038 public void test65() throws Throwable {
1039 RESTClient rESTClient0 = new RESTClient("");
1040 // Undeclared exception!
1043 fail("Expecting exception: IllegalStateException");
1045 } catch(IllegalStateException e) {
1047 // Target host is null
1049 verifyException("org.apache.http.util.Asserts", e);
1053 @Test(timeout = 4000)
1054 public void test66() throws Throwable {
1055 RESTClient rESTClient0 = new RESTClient("DELETE");
1056 // Undeclared exception!
1058 rESTClient0.httpDelete((String) null);
1059 fail("Expecting exception: IllegalStateException");
1061 } catch(IllegalStateException e) {
1063 // Target host is null
1065 verifyException("org.apache.http.util.Asserts", e);