aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/VfModuleStructureESTest.java
blob: e63680b4c7285ce1369210adfbb665171ac0b034 (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
/*
 * This file was automatically generated by EvoSuite
 * Fri Feb 24 13:34:51 GMT 2017
 */

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.MockitoExtension.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
import org.openecomp.mso.asdc.installer.IVfModuleData;
import org.openecomp.mso.asdc.installer.VfModuleArtifact;
import org.openecomp.mso.asdc.installer.VfModuleStructure;
import org.openecomp.mso.asdc.installer.VfResourceStructure;
import org.openecomp.mso.db.catalog.beans.VfModule;
import org.openecomp.sdc.api.notification.INotificationData;
import org.openecomp.sdc.api.notification.IResourceInstance;

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

    @Test(timeout = 4000)
    public void test0()  throws Throwable  {
        LinkedList<String> linkedList0 = new LinkedList<String>();
        IVfModuleData iVfModuleData0 = mock(IVfModuleData.class, new ViolatedAssumptionAnswer());
        doReturn(linkedList0).when(iVfModuleData0).getArtifacts();
        VfModuleStructure vfModuleStructure0 = new VfModuleStructure((VfResourceStructure) null, iVfModuleData0);
        VfModule vfModule0 = new VfModule();
        vfModule0.setIsBase(1);
        vfModuleStructure0.setCatalogVfModule(vfModule0);
        VfModule vfModule1 = vfModuleStructure0.getCatalogVfModule();
        assertNull(vfModule1.getModelInvariantUuid());
    }

    @Test(timeout = 4000)
    public void test1()  throws Throwable  {
        LinkedList<String> linkedList0 = new LinkedList<String>();
        IVfModuleData iVfModuleData0 = mock(IVfModuleData.class, new ViolatedAssumptionAnswer());
        doReturn(linkedList0).when(iVfModuleData0).getArtifacts();
        VfModuleStructure vfModuleStructure0 = new VfModuleStructure((VfResourceStructure) null, iVfModuleData0);
        VfModule vfModule0 = new VfModule();
        vfModuleStructure0.setCatalogVfModule(vfModule0);
        VfModule vfModule1 = vfModuleStructure0.getCatalogVfModule();
        assertNull(vfModule1.getModelVersion());
    }
 @Test(timeout = 4000)
    public void test4()  throws Throwable  {
        LinkedList<String> linkedList0 = new LinkedList<String>();
        IVfModuleData iVfModuleData0 = mock(IVfModuleData.class, new ViolatedAssumptionAnswer());
        doReturn(linkedList0).when(iVfModuleData0).getArtifacts();
        VfModuleStructure vfModuleStructure0 = new VfModuleStructure((VfResourceStructure) null, iVfModuleData0);
        Map<String, List<VfModuleArtifact>> map0 = vfModuleStructure0.getArtifactsMap();
        assertTrue(map0.isEmpty());
    }

    @Test(timeout = 4000)
    public void test5()  throws Throwable  {
        INotificationData iNotificationData0 = mock(INotificationData.class, new ViolatedAssumptionAnswer());
        IResourceInstance iResourceInstance0 = mock(IResourceInstance.class, new ViolatedAssumptionAnswer());
        VfResourceStructure vfResourceStructure0 = new VfResourceStructure(iNotificationData0, iResourceInstance0);
        IVfModuleData iVfModuleData0 = mock(IVfModuleData.class, new ViolatedAssumptionAnswer());
        doReturn((List) null).when(iVfModuleData0).getArtifacts();
        VfModuleStructure vfModuleStructure0 = null;
        try {
            vfModuleStructure0 = new VfModuleStructure(vfResourceStructure0, iVfModuleData0);
            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 test6()  throws Throwable  {
        LinkedList<String> linkedList0 = new LinkedList<String>();
        IVfModuleData iVfModuleData0 = mock(IVfModuleData.class, new ViolatedAssumptionAnswer());
        doReturn(linkedList0).when(iVfModuleData0).getArtifacts();
        VfModuleStructure vfModuleStructure0 = new VfModuleStructure((VfResourceStructure) null, iVfModuleData0);
        VfModule vfModule0 = vfModuleStructure0.getCatalogVfModule();
        assertNull(vfModule0);
    }
}