/* * This file was automatically generated by EvoSuite * Fri Nov 25 13:37:00 GMT 2016 */ package org.openecomp.mso.asdc.installer; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.junit.Test; import org.junit.runner.RunWith; import org.openecomp.sdc.api.notification.INotificationData; import org.openecomp.sdc.api.notification.IResourceInstance; import org.openecomp.sdc.api.notification.IVfModuleMetadata; import java.util.LinkedList; import java.util.List; import static org.evosuite.runtime.EvoAssertions.verifyException; import static org.evosuite.shaded.org.mockito.Mockito.doReturn; import static org.evosuite.shaded.org.mockito.Mockito.mock; import static org.junit.Assert.fail; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) public class VfModuleStructureESTest extends VfModuleStructureESTestscaffolding { @Test(timeout = 4000) public void test1() throws Throwable { INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer()); IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer()); VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0); IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer()); doReturn((List) null).when(iVfModuleMetadata0).getArtifacts(); VfModuleStructure vfModuleStructure0 = null; try { vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e); } } @Test(timeout = 4000) public void test2() throws Throwable { IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer()); doReturn((List) null).when(iVfModuleMetadata0).getArtifacts(); VfModuleStructure vfModuleStructure0 = null; try { vfModuleStructure0 = new VfModuleStructure((VfResourceStructure) null, iVfModuleMetadata0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e); } } @Test(timeout = 4000) public void test3() throws Throwable { INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer()); IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer()); VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0); LinkedList linkedList0 = new LinkedList(); IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer()); doReturn(linkedList0).when(iVfModuleMetadata0).getArtifacts(); linkedList0.add(""); VfModuleStructure vfModuleStructure0 = null; try { vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0); fail("Expecting exception: Exception"); } catch(Exception e) { // // Artifact (UUID:) referenced in the VFModule UUID list has not been downloaded, cancelling the Resource deployment // verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e); } } @Test(timeout = 4000) public void test4() throws Throwable { INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer()); IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer()); VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0); vfResourceStructure0.setSuccessfulDeployment(); IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer()); doReturn((List) null).when(iVfModuleMetadata0).getArtifacts(); vfResourceStructure0.setSuccessfulDeployment(); VfModuleStructure vfModuleStructure0 = null; try { vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e); } } }