Initial OpenECOMP MSO commit
[so.git] / asdc-controller / src / test / java / org / openecomp / mso / asdc / installer / VfModuleStructureESTest.java
1 /*
2  * This file was automatically generated by EvoSuite
3  * Fri Nov 25 13:37:00 GMT 2016
4  */
5
6 package org.openecomp.mso.asdc.installer;
7
8 import org.evosuite.runtime.EvoRunner;
9 import org.evosuite.runtime.EvoRunnerParameters;
10 import org.evosuite.runtime.ViolatedAssumptionAnswer;
11 import org.junit.Test;
12 import org.junit.runner.RunWith;
13 import org.openecomp.sdc.api.notification.INotificationData;
14 import org.openecomp.sdc.api.notification.IResourceInstance;
15 import org.openecomp.sdc.api.notification.IVfModuleMetadata;
16
17 import java.util.LinkedList;
18 import java.util.List;
19
20 import static org.evosuite.runtime.EvoAssertions.verifyException;
21 import static org.evosuite.shaded.org.mockito.Mockito.doReturn;
22 import static org.evosuite.shaded.org.mockito.Mockito.mock;
23 import static org.junit.Assert.fail;
24
25 @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
26 public class VfModuleStructureESTest extends VfModuleStructureESTestscaffolding {
27
28   @Test(timeout = 4000)
29   public void test1()  throws Throwable  {
30       INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
31       IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer());
32       VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0);
33       IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer());
34       doReturn((List) null).when(iVfModuleMetadata0).getArtifacts();
35       VfModuleStructure vfModuleStructure0 = null;
36       try {
37         vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0);
38         fail("Expecting exception: NullPointerException");
39       
40       } catch(NullPointerException e) {
41          //
42          // no message in exception (getMessage() returned null)
43          //
44          verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e);
45       }
46   }
47
48   @Test(timeout = 4000)
49   public void test2()  throws Throwable  {
50       IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer());
51       doReturn((List) null).when(iVfModuleMetadata0).getArtifacts();
52       VfModuleStructure vfModuleStructure0 = null;
53       try {
54         vfModuleStructure0 = new VfModuleStructure((VfResourceStructure) null, iVfModuleMetadata0);
55         fail("Expecting exception: NullPointerException");
56       
57       } catch(NullPointerException e) {
58          //
59          // no message in exception (getMessage() returned null)
60          //
61          verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e);
62       }
63   }
64
65   @Test(timeout = 4000)
66   public void test3()  throws Throwable  {
67       INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
68       IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer());
69       VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0);
70       LinkedList<String> linkedList0 = new LinkedList<String>();
71       IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer());
72       doReturn(linkedList0).when(iVfModuleMetadata0).getArtifacts();
73       linkedList0.add("");
74       VfModuleStructure vfModuleStructure0 = null;
75       try {
76         vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0);
77         fail("Expecting exception: Exception");
78       
79       } catch(Exception e) {
80          //
81          // Artifact (UUID:) referenced in the VFModule UUID list has not been downloaded, cancelling the Resource deployment
82          //
83          verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e);
84       }
85   }
86
87   @Test(timeout = 4000)
88   public void test4()  throws Throwable  {
89       INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
90       IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer());
91       VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0);
92       vfResourceStructure0.setSuccessfulDeployment();
93       IVfModuleMetadata iVfModuleMetadata0 = mock(IVfModuleMetadata.class, new ViolatedAssumptionAnswer());
94       doReturn((List) null).when(iVfModuleMetadata0).getArtifacts();
95       vfResourceStructure0.setSuccessfulDeployment();
96       VfModuleStructure vfModuleStructure0 = null;
97       try {
98         vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleMetadata0);
99         fail("Expecting exception: NullPointerException");
100       
101       } catch(NullPointerException e) {
102          //
103          // no message in exception (getMessage() returned null)
104          //
105          verifyException("org.openecomp.mso.asdc.installer.VfModuleStructure", e);
106       }
107   }
108 }