aboutsummaryrefslogtreecommitdiffstats
path: root/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/ResultTest.java
blob: c6365ae1e660e7c5c21cedccfb41be52bbb06dad (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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
package org.onap.ccsdk.sli.adaptors.aai.query;

import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;

import java.util.HashMap;
import java.util.Map;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import org.onap.aai.inventory.v19.CloudRegion;
import org.onap.aai.inventory.v19.Complex;
import org.onap.aai.inventory.v19.Configuration;
import org.onap.aai.inventory.v19.GenericVnf;
import org.onap.aai.inventory.v19.L3InterfaceIpv4AddressList;
import org.onap.aai.inventory.v19.L3InterfaceIpv6AddressList;
import org.onap.aai.inventory.v19.L3Network;
import org.onap.aai.inventory.v19.LInterface;
//import org.onap.aai.inventory.v19.OwningEntity;
import org.onap.aai.inventory.v19.Pserver;
import org.onap.aai.inventory.v19.ServiceInstance;
import org.onap.aai.inventory.v19.Vnfc;
import org.onap.aai.inventory.v19.Vserver;

public class ResultTest {

    Result _rInstance;

    protected CloudRegion _cloudRegion;
    protected Complex _complex;
    protected Configuration _configuration;
    protected GenericVnf _genericVnf;
    protected L3InterfaceIpv4AddressList _l3InterfaceIpv4AddressList;
    protected L3InterfaceIpv6AddressList _l3InterfaceIpv6AddressList;
    protected L3Network _l3Network;
    protected LInterface _lInterface;
    protected Pserver _pserver;
    protected ServiceInstance _serviceInstance;
    protected Vnfc _vnfc;
    protected Vserver _vserver;

    protected Map<String, Object> _additionalProperties;

    @Before
    public void setUp() throws Exception {
        _rInstance = new Result();

         CloudRegion _cloudRegion = mock(CloudRegion.class);
         Complex _complex = mock(Complex.class);
         Configuration _configuration = mock(Configuration.class);
         L3InterfaceIpv4AddressList _l3InterfaceIpv4AddressList = mock(L3InterfaceIpv4AddressList.class);
         L3InterfaceIpv6AddressList _l3InterfaceIpv6AddressList = mock(L3InterfaceIpv6AddressList.class);
         L3Network _l3Network = mock(L3Network.class);
         LInterface _pInterface = mock(LInterface.class);
         GenericVnf _genericVnf = mock(GenericVnf.class);
         Vserver _vserver = mock(Vserver.class);
         Pserver _pserver = mock(Pserver.class);
         Vnfc _vnfc = mock(Vnfc.class);
         ServiceInstance _serviceInstance = mock(ServiceInstance.class);

        _additionalProperties = new HashMap<String, Object>() {{
            put("prop1", "propvalue1");
            put("prop2", "propvalue2");
        }};
    }

    @After
    public void tearDown() throws Exception {
        _rInstance = null;
        _additionalProperties = null;
    }

    @Test
    public void testSetComplex() {
        _rInstance.setComplex(_complex);
        assertEquals(_rInstance.getComplex(), _complex);
    }

    @Test
    public void testSetConfiguration() {
        _rInstance.setConfiguration(_configuration);
        assertEquals(_rInstance.getConfiguration(), _configuration);
    }

    @Test
    public void testSetL3InterfaceIpv4AddressList() {
        _rInstance.setL3InterfaceIpv4AddressList(_l3InterfaceIpv4AddressList);
        assertEquals(_rInstance.getL3InterfaceIpv4AddressList(), _l3InterfaceIpv4AddressList);
    }

    @Test
    public void testSetL3InterfaceIpv6AddressList() {
        _rInstance.setL3InterfaceIpv6AddressList(_l3InterfaceIpv6AddressList);
        assertEquals(_rInstance.getL3InterfaceIpv6AddressList(), _l3InterfaceIpv6AddressList);
    }

    @Test
    public void testSetL3Network() {
        _rInstance.setL3Network(_l3Network);
        assertEquals(_rInstance.getL3Network(), _l3Network);
    }

    @Test
    public void testSetServiceInstance() {
        _rInstance.setServiceInstance(_serviceInstance);
        assertEquals(_rInstance.getServiceInstance(), _serviceInstance);
    }

    @Test
    public void testSetGenericVnf() {
        _rInstance.setGenericVnf(_genericVnf);
        assertEquals(_rInstance.getGenericVnf(), _genericVnf);
    }

    @Test
    public void testSetVserver() {
        _rInstance.setVserver(_vserver);
        assertEquals(_rInstance.getVserver(), _vserver);
    }

    @Test
    public void testSetCloudRegion() {
        _rInstance.setCloudRegion(_cloudRegion);
        assertEquals(_rInstance.getCloudRegion(), _cloudRegion);
    }

    @Test
    public void testSetVnfc() {
        _rInstance.setVnfc(_vnfc);
        assertEquals(_rInstance.getVnfc(), _vnfc);
    }

    @Test
    public void testSetLInterface() {
        _rInstance.setLInterface(_lInterface);
        assertEquals(_rInstance.getLInterface(), _lInterface);
    }

    @Test
    public void testSetPserver() {
        _rInstance.setPserver(_pserver);
        assertEquals(_rInstance.getPserver(), _pserver);
    }

    @Test
    public void testSetAdditionalProperty() {
        _rInstance.setAdditionalProperty("prop1", "propvalue1");
        _rInstance.setAdditionalProperty("prop2", "propvalue2");
        assertEquals(_rInstance.getAdditionalProperties(), _additionalProperties);
    }

    @Test
    public void testToString() {
         assertNotNull(_rInstance.toString());
    }

}