Merge "Reorder modifiers"
[so.git] / adapters / mso-adapter-utils / src / test / java / org / openecomp / mso / openstack / beans / NetworkRollbackTest.java
1 /*
2 * ============LICENSE_START=======================================================
3 * ONAP : SO
4 * ================================================================================
5 * Copyright 2018 TechMahindra
6 *=================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *     http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20
21 package org.openecomp.mso.openstack.beans;
22
23 import static org.junit.Assert.*;
24 import java.util.ArrayList;
25 import java.util.List;
26 import org.junit.Test;
27 import org.mockito.InjectMocks;
28 import org.mockito.Mock;
29 import org.openecomp.mso.entity.MsoRequest;
30
31 public class NetworkRollbackTest {
32     @Mock
33     MsoRequest ms = new MsoRequest();
34
35     @InjectMocks
36     NetworkRollback nr = new NetworkRollback();
37  
38     @Test
39     public void test() {
40         List<Integer> vlans = new ArrayList();
41        vlans.add(1);
42        vlans.add(2); 
43         nr.setCloudId("cloudId");
44         nr.setModelCustomizationUuid("modelCustomizationUuid");
45         nr.setNetworkId("networkId");
46         nr.setNetworkName("networkName");
47         nr.setNetworkStackId("networkStackId");
48         nr.setNetworkType("networkType");;
49         nr.setNeutronNetworkId("neutronNetworkId");
50         nr.setPhysicalNetwork("physicalNetwork");
51         nr.setTenantId("tenantId");
52         nr.setNetworkCreated(false);
53         nr.setVlans(vlans);
54         nr.setMsoRequest(ms);
55         assert(nr.getCloudId().equals("cloudId"));
56         assert(nr.getModelCustomizationUuid().equals("modelCustomizationUuid"));
57         assert(nr.getNetworkId().equals("networkId"));
58         assert(nr.getNetworkName().equals("networkName"));
59         assert(nr.getNetworkStackId().equals("networkStackId"));
60         assert(nr.getNeutronNetworkId().equals("neutronNetworkId"));
61         assert(nr.getPhysicalNetwork().equals("physicalNetwork"));
62         assert(nr.getNetworkType().equals("networkType"));
63         assert(nr.getTenantId().equals("tenantId"));
64         assert(nr.getMsoRequest().equals(ms));
65         assertFalse(nr.getNetworkCreated());
66         assert(nr.getVlans().equals(vlans));
67         assert(nr.toString()!=null);    
68     }
69 }