Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-adapter-utils / src / test / java / org / onap / so / openstack / beans / VnfRollbackTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
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.onap.so.openstack.beans;
22
23 import static org.junit.Assert.assertEquals;
24 import org.junit.Test;
25 import org.onap.so.BaseTest;
26 import org.onap.so.entity.MsoRequest;
27 import org.springframework.beans.factory.annotation.Autowired;
28
29 public class VnfRollbackTest extends BaseTest {
30     @Autowired
31     private VnfRollback vnfRollback;
32
33     private String vnfId = "testVnfId";
34     private String tenantId = "testTenantId";
35     private String cloudOwner = "testCloudOwner";
36     private String cloudSiteId = "testCloudSiteId";
37     private boolean tenantCreated = true;
38     private boolean vnfCreated = true;
39     private MsoRequest msoRequest = new MsoRequest();
40     private String volumeGroupName = "testVolumeGroupName";
41     private String volumeGroupId = "testVolumeGroupId";
42     private String requestType = "testRequestType";
43     private String modelCustomizationUuid = "testModelCustimizationUuid";
44     private String orchestrationMode = "testOrchestrationMode";
45     private static final String VNF_ROLLBACK_STRING =
46             "VnfRollback: cloud=testCloudSiteId, cloudOwner=testCloudOwner, tenant=testTenantId, vnf=testVnfId, "
47                     + "tenantCreated=true, vnfCreated=true, requestType = testRequestType, modelCustomizationUuid=testModelCustimizationUuid, mode=testOrchestrationMode";
48
49     @Test
50     public void VnfRollbackInstantiationTest() {
51         vnfRollback = new VnfRollback(vnfId, tenantId, cloudOwner, cloudSiteId, tenantCreated, vnfCreated, msoRequest,
52                 volumeGroupName, volumeGroupId, requestType, modelCustomizationUuid);
53
54         assertEquals(vnfId, vnfRollback.getVnfId());
55         assertEquals(tenantId, vnfRollback.getTenantId());
56         assertEquals(cloudOwner, vnfRollback.getCloudOwner());
57         assertEquals(cloudSiteId, vnfRollback.getCloudSiteId());
58         assertEquals(tenantCreated, vnfRollback.getTenantCreated());
59         assertEquals(vnfCreated, vnfRollback.getVnfCreated());
60         assertEquals(msoRequest, vnfRollback.getMsoRequest());
61         assertEquals(volumeGroupName, vnfRollback.getVolumeGroupName());
62         assertEquals(volumeGroupId, vnfRollback.getVolumeGroupId());
63         assertEquals(requestType, vnfRollback.getRequestType());
64         assertEquals(modelCustomizationUuid, vnfRollback.getModelCustomizationUuid());
65     }
66
67     @Test
68     public void VnfRollbackInstantiationOrchestrationModeTest() {
69         vnfRollback = new VnfRollback(vnfId, tenantId, cloudOwner, cloudSiteId, tenantCreated, vnfCreated, msoRequest,
70                 volumeGroupName, volumeGroupId, requestType, modelCustomizationUuid, orchestrationMode);
71
72         assertEquals(vnfId, vnfRollback.getVnfId());
73         assertEquals(tenantId, vnfRollback.getTenantId());
74         assertEquals(cloudOwner, vnfRollback.getCloudOwner());
75         assertEquals(cloudSiteId, vnfRollback.getCloudSiteId());
76         assertEquals(tenantCreated, vnfRollback.getTenantCreated());
77         assertEquals(vnfCreated, vnfRollback.getVnfCreated());
78         assertEquals(msoRequest, vnfRollback.getMsoRequest());
79         assertEquals(volumeGroupName, vnfRollback.getVolumeGroupName());
80         assertEquals(volumeGroupId, vnfRollback.getVolumeGroupId());
81         assertEquals(requestType, vnfRollback.getRequestType());
82         assertEquals(modelCustomizationUuid, vnfRollback.getModelCustomizationUuid());
83         assertEquals(orchestrationMode, vnfRollback.getMode());
84     }
85
86     @Test
87     public void toStringTest() {
88         vnfRollback = new VnfRollback(vnfId, tenantId, cloudOwner, cloudSiteId, tenantCreated, vnfCreated, msoRequest,
89                 volumeGroupName, volumeGroupId, requestType, modelCustomizationUuid, orchestrationMode);
90
91         assertEquals(VNF_ROLLBACK_STRING, vnfRollback.toString());
92     }
93 }