57f2d5d7a8cd934447aa758ba3a4344344f7738e
[so.git] / mso-catalog-db / src / test / java / org / openecomp / mso / db / catalog / beans / ServiceESTest.java
1 /*
2  * This file was automatically generated by EvoSuite
3  * Mon Nov 14 08:19:44 GMT 2016
4  */
5
6 package org.openecomp.mso.db.catalog.beans;
7
8 import org.junit.Test;
9 import static org.junit.Assert.*;
10 import static org.evosuite.shaded.org.mockito.Mockito.*;
11 import static org.evosuite.runtime.EvoAssertions.*;
12
13 import java.sql.Timestamp;
14 import java.time.Clock;
15 import java.time.LocalDateTime;
16 import java.util.HashMap;
17 import java.util.Map;
18 import java.util.Set;
19 import org.evosuite.runtime.EvoRunner;
20 import org.evosuite.runtime.EvoRunnerParameters;
21 import org.evosuite.runtime.ViolatedAssumptionAnswer;
22 import org.evosuite.runtime.mock.java.time.MockClock;
23 import org.evosuite.runtime.mock.java.time.MockLocalDateTime;
24 import org.junit.runner.RunWith;
25
26 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
27 public class ServiceESTest extends ServiceESTestscaffolding {
28
29   @Test(timeout = 4000)
30   public void test00()  throws Throwable  {
31       Service service0 = new Service();
32       service0.setServiceVersion("RECIPE: ");
33       String string0 = service0.getServiceVersion();
34       assertEquals("RECIPE: ", string0);
35   }
36
37   @Test(timeout = 4000)
38   public void test01()  throws Throwable  {
39       Service service0 = new Service();
40       service0.setServiceNameVersionId(">{PeD}EDcITG;{Z%FH");
41       String string0 = service0.getServiceNameVersionId();
42       assertEquals(">{PeD}EDcITG;{Z%FH", string0);
43   }
44
45   @Test(timeout = 4000)
46   public void test02()  throws Throwable  {
47       Service service0 = new Service();
48       service0.setServiceName("RECIPE: ");
49       String string0 = service0.getServiceName();
50       assertEquals("RECIPE: ", string0);
51   }
52
53   @Test(timeout = 4000)
54   public void test03()  throws Throwable  {
55       Service service0 = new Service();
56       service0.setServiceName("");
57       String string0 = service0.getServiceName();
58       assertEquals("", string0);
59   }
60
61   @Test(timeout = 4000)
62   public void test04()  throws Throwable  {
63       Service service0 = new Service();
64       HashMap<String, ServiceRecipe> hashMap0 = new HashMap<String, ServiceRecipe>();
65       ServiceRecipe serviceRecipe0 = new ServiceRecipe();
66       hashMap0.put(",created=", serviceRecipe0);
67       service0.setRecipes(hashMap0);
68       Map<String, ServiceRecipe> map0 = service0.getRecipes();
69       assertFalse(map0.isEmpty());
70   }
71
72   @Test(timeout = 4000)
73   public void test05()  throws Throwable  {
74       Service service0 = new Service();
75       service0.setModelInvariantUUID("BZ@s");
76       String string0 = service0.getModelInvariantUUID();
77       assertEquals("BZ@s", string0);
78   }
79
80   @Test(timeout = 4000)
81   public void test06()  throws Throwable  {
82       Service service0 = new Service();
83       service0.setId(1033);
84       int int0 = service0.getId();
85       assertEquals(1033, int0);
86   }
87
88   @Test(timeout = 4000)
89   public void test07()  throws Throwable  {
90       Service service0 = new Service();
91       service0.setId((-164));
92       int int0 = service0.getId();
93       assertEquals((-164), int0);
94   }
95
96   @Test(timeout = 4000)
97   public void test08()  throws Throwable  {
98       Service service0 = new Service();
99       service0.setHttpMethod(",description=");
100       String string0 = service0.getHttpMethod();
101       assertEquals(",description=", string0);
102   }
103
104   @Test(timeout = 4000)
105   public void test09()  throws Throwable  {
106       Service service0 = new Service();
107       service0.setDescription("");
108       String string0 = service0.getDescription();
109       assertEquals("", string0);
110   }
111
112   @Test(timeout = 4000)
113   public void test10()  throws Throwable  {
114       Service service0 = new Service();
115       Timestamp timestamp0 = new Timestamp(0L);
116       service0.setCreated(timestamp0);
117       Timestamp timestamp1 = service0.getCreated();
118       assertEquals(0, timestamp1.getNanos());
119   }
120
121   @Test(timeout = 4000)
122   public void test11()  throws Throwable  {
123       Service service0 = new Service();
124       Clock clock0 = MockClock.systemUTC();
125       LocalDateTime localDateTime0 = MockLocalDateTime.now(clock0);
126       Timestamp timestamp0 = Timestamp.valueOf(localDateTime0);
127       service0.setCreated(timestamp0);
128       Timestamp timestamp1 = service0.getCreated();
129       assertSame(timestamp1, timestamp0);
130   }
131
132   @Test(timeout = 4000)
133   public void test12()  throws Throwable  {
134       Service service0 = new Service();
135       // Undeclared exception!
136       try { 
137         service0.toString();
138         fail("Expecting exception: NullPointerException");
139       
140       } catch(NullPointerException e) {
141          //
142          // no message in exception (getMessage() returned null)
143          //
144          verifyException("org.openecomp.mso.db.catalog.beans.Service", e);
145       }
146   }
147
148   @Test(timeout = 4000)
149   public void test13()  throws Throwable  {
150       Service service0 = new Service();
151       HashMap<String, ServiceRecipe> hashMap0 = new HashMap<String, ServiceRecipe>();
152       ServiceRecipe serviceRecipe0 = new ServiceRecipe();
153       hashMap0.put(",created=", serviceRecipe0);
154       service0.setRecipes(hashMap0);
155       String string0 = service0.toString();
156       assertEquals("SERVICE: id=0,name=null,version=null,description=null,modelInvariantUUID=null\nRECIPE: null,uri=null", string0);
157   }
158
159   @Test(timeout = 4000)
160   public void test14()  throws Throwable  {
161       Service service0 = new Service();
162       service0.setServiceNameVersionId("83y*#72]},kHXOT");
163       service0.setServiceNameVersionId("f6t}qujI)DMM>b=J");
164       Map<String, ServiceRecipe> map0 = (Map<String, ServiceRecipe>) mock(Map.class, new ViolatedAssumptionAnswer());
165       doReturn((String) null).when(map0).toString();
166       doReturn((Set) null).when(map0).keySet();
167       service0.setRecipes(map0);
168       service0.isTheSameVersion("83y*#72]},kHXOT");
169       service0.isMoreRecentThan(")0");
170       service0.getRecipes();
171       // Undeclared exception!
172       try { 
173         service0.toString();
174         fail("Expecting exception: NullPointerException");
175       
176       } catch(NullPointerException e) {
177          //
178          // no message in exception (getMessage() returned null)
179          //
180          verifyException("org.openecomp.mso.db.catalog.beans.Service", e);
181       }
182   }
183
184   @Test(timeout = 4000)
185   public void test15()  throws Throwable  {
186       Service service0 = new Service();
187       String string0 = service0.getDescription();
188       assertNull(string0);
189   }
190
191   @Test(timeout = 4000)
192   public void test16()  throws Throwable  {
193       Service service0 = new Service();
194       HashMap<String, ServiceRecipe> hashMap0 = new HashMap<String, ServiceRecipe>();
195       service0.setRecipes(hashMap0);
196       Map<String, ServiceRecipe> map0 = service0.getRecipes();
197       assertEquals(0, map0.size());
198   }
199
200   @Test(timeout = 4000)
201   public void test17()  throws Throwable  {
202       Service service0 = new Service();
203       int int0 = service0.getId();
204       assertEquals(0, int0);
205   }
206
207   @Test(timeout = 4000)
208   public void test18()  throws Throwable  {
209       Service service0 = new Service();
210       String string0 = service0.getServiceName();
211       assertNull(string0);
212   }
213
214   @Test(timeout = 4000)
215   public void test19()  throws Throwable  {
216       Service service0 = new Service();
217       service0.setHttpMethod("");
218       String string0 = service0.getHttpMethod();
219       assertEquals("", string0);
220   }
221
222   @Test(timeout = 4000)
223   public void test20()  throws Throwable  {
224       Service service0 = new Service();
225       String string0 = service0.getModelInvariantUUID();
226       assertNull(string0);
227   }
228
229   @Test(timeout = 4000)
230   public void test21()  throws Throwable  {
231       Service service0 = new Service();
232       String string0 = service0.getServiceVersion();
233       assertNull(string0);
234   }
235
236   @Test(timeout = 4000)
237   public void test22()  throws Throwable  {
238       Service service0 = new Service();
239       service0.setServiceNameVersionId("");
240       String string0 = service0.getServiceNameVersionId();
241       assertEquals("", string0);
242   }
243
244   @Test(timeout = 4000)
245   public void test23()  throws Throwable  {
246       Service service0 = new Service();
247       String string0 = service0.getHttpMethod();
248       assertNull(string0);
249   }
250
251   @Test(timeout = 4000)
252   public void test24()  throws Throwable  {
253       Service service0 = new Service();
254       Map<String, ServiceRecipe> map0 = service0.getRecipes();
255       assertNull(map0);
256   }
257
258   @Test(timeout = 4000)
259   public void test25()  throws Throwable  {
260       Service service0 = new Service();
261       service0.setDescription("Ir%#'ua8B=h&yW\"(|");
262       String string0 = service0.getDescription();
263       assertEquals("Ir%#'ua8B=h&yW\"(|", string0);
264   }
265
266   @Test(timeout = 4000)
267   public void test26()  throws Throwable  {
268       Service service0 = new Service();
269       String string0 = service0.getServiceNameVersionId();
270       assertNull(string0);
271   }
272
273   @Test(timeout = 4000)
274   public void test27()  throws Throwable  {
275       Service service0 = new Service();
276       service0.setServiceVersion("");
277       String string0 = service0.getServiceVersion();
278       assertEquals("", string0);
279   }
280
281   @Test(timeout = 4000)
282   public void test28()  throws Throwable  {
283       Service service0 = new Service();
284       Timestamp timestamp0 = service0.getCreated();
285       service0.setCreated(timestamp0);
286       assertNull(service0.getServiceName());
287   }
288
289   @Test(timeout = 4000)
290   public void test29()  throws Throwable  {
291       Service service0 = new Service();
292       service0.setModelInvariantUUID("");
293       String string0 = service0.getModelInvariantUUID();
294       assertEquals("", string0);
295   }
296 }