aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/ASDCElementInfoESTest.java
blob: 8dd5afe7e06081cdefc69fa488d5ad5fed57e6e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
 * This file was automatically generated by EvoSuite
 * Fri Nov 25 13:35:55 GMT 2016
 */

package org.openecomp.mso.asdc.installer;

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.List;
import java.util.Map;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.PrivateAccess;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
import org.openecomp.sdc.api.notification.IArtifactInfo;
import org.openecomp.sdc.api.notification.INotificationData;
import org.openecomp.sdc.api.notification.IResourceInstance;
import org.openecomp.sdc.api.notification.IVfModuleMetadata;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
public class ASDCElementInfoESTest extends ASDCElementInfoESTestscaffolding {

  @Test(timeout = 4000)
  public void test00()  throws Throwable  {
      INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
      IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer());
      doReturn((String) null).when(iResourceInstance0).getResourceInstanceName();
      doReturn((String) null).when(iResourceInstance0).getResourceInvariantUUID();
      VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0);
      ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfResourceStructure(vfResourceStructure0);
      String string0 = aSDCElementInfo0.getType();
      assertEquals("VNF_RESOURCE", string0);
  }

  @Test(timeout = 4000)
  public void test01()  throws Throwable  {
      ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfModuleStructure((VfModuleStructure) null);
      Map<String, String> map0 = aSDCElementInfo0.getElementInfoMap();
      assertTrue(map0.isEmpty());
  }

  @Test(timeout = 4000)
  public void test02()  throws Throwable  {
      Map<String, String> map0 = ASDCElementInfo.EMPTY_INSTANCE.getElementInfoMap();
      assertTrue(map0.isEmpty());
  }

  @Test(timeout = 4000)
  public void test03()  throws Throwable  {
      ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.EMPTY_INSTANCE;
      IArtifactInfo iArtifactInfo0 = mock(IArtifactInfo.class, new ViolatedAssumptionAnswer());
      doReturn((String) null).when(iArtifactInfo0).getArtifactName();
      doReturn((String) null).when(iArtifactInfo0).getArtifactType();
      doReturn((String) null).when(iArtifactInfo0).getArtifactUUID();
      ASDCElementInfo aSDCElementInfo1 = ASDCElementInfo.createElementFromVfArtifactInfo(iArtifactInfo0);
      aSDCElementInfo0.toString();
      PrivateAccess.setVariable((Class<ASDCElementInfo>) ASDCElementInfo.class, aSDCElementInfo1, "elementInfoMap", (Object) null);
      aSDCElementInfo0.toString();
      // Undeclared exception!
      try { 
        aSDCElementInfo1.toString();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.openecomp.mso.asdc.installer.ASDCElementInfo", e);
      }
  }

  @Test(timeout = 4000)
  public void test05()  throws Throwable  {
      ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.EMPTY_INSTANCE;
      aSDCElementInfo0.addElementInfo("V$", (String) null);
      assertEquals("", aSDCElementInfo0.getType());
  }

  @Test(timeout = 4000)
  public void test06()  throws Throwable  {
      ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfModuleStructure((VfModuleStructure) null);
      String string0 = aSDCElementInfo0.EMPTY_INSTANCE.getType();
      assertEquals("", string0);
  }

  @Test(timeout = 4000)
  public void test07()  throws Throwable  {
      INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
      VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, (IResourceInstance) null);
      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 test08()  throws Throwable  {
      INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
      IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer());
      doReturn(" Name").when(iResourceInstance0).getResourceInstanceName();
      doReturn(" Name").when(iResourceInstance0).getResourceInvariantUUID();
      VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0);
      ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfResourceStructure(vfResourceStructure0);
      String string0 = aSDCElementInfo0.toString();
      assertEquals("Resource Instance Invariant UUID:  Name, Resource Instance Name:  Name", string0);
  }

  @Test(timeout = 4000)
  public void test09()  throws Throwable  {
      ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfArtifactInfo((IArtifactInfo) null);
      aSDCElementInfo0.addElementInfo((String) null, "");
      assertEquals("", aSDCElementInfo0.getType());
  }

  @Test(timeout = 4000)
  public void test10()  throws Throwable  {
      IArtifactInfo iArtifactInfo0 = mock(IArtifactInfo.class, new ViolatedAssumptionAnswer());
      doReturn((String) null).when(iArtifactInfo0).getArtifactName();
      doReturn((String) null).when(iArtifactInfo0).getArtifactType();
      doReturn((String) null).when(iArtifactInfo0).getArtifactUUID();
      ASDCElementInfo aSDCElementInfo0 = ASDCElementInfo.createElementFromVfArtifactInfo(iArtifactInfo0);
      String string0 = aSDCElementInfo0.getType();
      assertNull(string0);
  }
}