/* * This file was automatically generated by EvoSuite * Mon Feb 20 14:04:40 GMT 2017 */ package org.openecomp.mso.adapters.catalogrest; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import java.util.Collection; import java.util.LinkedList; import java.util.List; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.junit.runner.RunWith; import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) public class QueryServiceNetworksESTest extends QueryServiceNetworksESTestscaffolding { @Test(timeout = 4000) public void test0() throws Throwable { LinkedList linkedList0 = new LinkedList(); QueryServiceNetworks queryServiceNetworks0 = new QueryServiceNetworks((List) linkedList0); queryServiceNetworks0.setServiceNetworks((List) null); List list0 = queryServiceNetworks0.getServiceNetworks(); assertNull(list0); } @Test(timeout = 4000) public void test1() throws Throwable { LinkedList linkedList0 = new LinkedList(); QueryServiceNetworks queryServiceNetworks0 = new QueryServiceNetworks(); Object[] objectArray0 = new Object[3]; objectArray0[0] = (Object) queryServiceNetworks0; Collection collection0 = (Collection) mock(Collection.class, new ViolatedAssumptionAnswer()); doReturn(objectArray0).when(collection0).toArray(); linkedList0.addAll(collection0); queryServiceNetworks0.setServiceNetworks(linkedList0); // Undeclared exception! try { queryServiceNetworks0.toString(); fail("Expecting exception: ClassCastException"); } catch(ClassCastException e) { // // org.openecomp.mso.adapters.catalogrest.QueryServiceNetworks cannot be cast to org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization // verifyException("org.openecomp.mso.adapters.catalogrest.QueryServiceNetworks", e); } } @Test(timeout = 4000) public void test2() throws Throwable { QueryServiceNetworks queryServiceNetworks0 = null; try { queryServiceNetworks0 = new QueryServiceNetworks((List) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.openecomp.mso.adapters.catalogrest.QueryServiceNetworks", e); } } @Test(timeout = 4000) public void test3() throws Throwable { LinkedList linkedList0 = new LinkedList(); NetworkResourceCustomization networkResourceCustomization0 = new NetworkResourceCustomization(); linkedList0.add(networkResourceCustomization0); Object[] objectArray0 = new Object[4]; objectArray0[0] = (Object) linkedList0; Collection collection0 = (Collection) mock(Collection.class, new ViolatedAssumptionAnswer()); doReturn(objectArray0).when(collection0).toArray(); linkedList0.addAll(1, collection0); QueryServiceNetworks queryServiceNetworks0 = null; try { queryServiceNetworks0 = new QueryServiceNetworks((List) linkedList0); fail("Expecting exception: ClassCastException"); } catch(ClassCastException e) { // // java.util.LinkedList cannot be cast to org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization // verifyException("org.openecomp.mso.adapters.catalogrest.QueryServiceNetworks", e); } } @Test(timeout = 4000) public void test4() throws Throwable { LinkedList linkedList0 = new LinkedList(); QueryServiceNetworks queryServiceNetworks0 = new QueryServiceNetworks(); queryServiceNetworks0.setServiceNetworks(linkedList0); NetworkResourceCustomization networkResourceCustomization0 = new NetworkResourceCustomization(); linkedList0.add(networkResourceCustomization0); linkedList0.add(networkResourceCustomization0); String string0 = queryServiceNetworks0.toString(); assertEquals("1\tmodelName=nullmodelUuid=nullmodelUuid=nullmodelInvariantUuid=nullmodelVersion=nullmodelCustomizationUuid=nullmodelInstanceName=nullnetworkResourceId=0networkType=null1\t\nmodelName=nullmodelUuid=nullmodelUuid=nullmodelInvariantUuid=nullmodelVersion=nullmodelCustomizationUuid=nullmodelInstanceName=nullnetworkResourceId=0networkType=null", string0); } @Test(timeout = 4000) public void test5() throws Throwable { QueryServiceNetworks queryServiceNetworks0 = new QueryServiceNetworks(); String string0 = queryServiceNetworks0.toString(); assertEquals("", string0); } @Test(timeout = 4000) public void test6() throws Throwable { LinkedList linkedList0 = new LinkedList(); NetworkResourceCustomization networkResourceCustomization0 = new NetworkResourceCustomization(); linkedList0.add(networkResourceCustomization0); QueryServiceNetworks queryServiceNetworks0 = new QueryServiceNetworks((List) linkedList0); List list0 = queryServiceNetworks0.getServiceNetworks(); assertEquals(1, list0.size()); } @Test(timeout = 4000) public void test7() throws Throwable { LinkedList linkedList0 = new LinkedList(); QueryServiceNetworks queryServiceNetworks0 = new QueryServiceNetworks((List) linkedList0); queryServiceNetworks0.setServiceNetworks((List) null); // Undeclared exception! try { queryServiceNetworks0.toString(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.openecomp.mso.adapters.catalogrest.QueryServiceNetworks", e); } } @Test(timeout = 4000) public void test8() throws Throwable { QueryServiceNetworks queryServiceNetworks0 = new QueryServiceNetworks(); List list0 = queryServiceNetworks0.getServiceNetworks(); assertTrue(list0.isEmpty()); } @Test(timeout = 4000) public void test9() throws Throwable { QueryServiceNetworks queryServiceNetworks0 = new QueryServiceNetworks(); // Undeclared exception! try { queryServiceNetworks0.toJsonString(); fail("Expecting exception: VerifyError"); } catch(VerifyError e) { // // (class: org/codehaus/jackson/map/MapperConfig, method: signature: ()V) Bad type in putfield/putstatic // verifyException("org.codehaus.jackson.map.ObjectMapper", e); } } }