Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-adapter-utils / src / test / java / org / onap / so / cloud / CloudConfigTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 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.cloud;
22
23 import static org.junit.Assert.*;
24 import java.util.Optional;
25 import org.junit.Test;
26 import org.onap.so.BaseTest;
27 import org.onap.so.db.catalog.beans.AuthenticationType;
28 import org.onap.so.db.catalog.beans.CloudIdentity;
29 import org.onap.so.db.catalog.beans.CloudSite;
30 import org.onap.so.db.catalog.beans.ServerType;
31 import org.onap.so.openstack.exceptions.MsoException;
32 import org.springframework.beans.factory.annotation.Autowired;
33
34 /**
35  * This class implements test methods of the CloudConfig features.
36  *
37  *
38  */
39 public class CloudConfigTest extends BaseTest {
40
41     @Autowired
42     private CloudConfig con;
43
44     /**
45      * This method implements a test for the getCloudSite method.
46      */
47     @Test
48     public final void testGetCloudSite() {
49         CloudSite site1 = con.getCloudSite("MTN13").get();
50
51         assertEquals("mtn13", site1.getRegionId());
52         assertEquals("mtn13", site1.getIdentityServiceId());
53         assertEquals("MDT13", site1.getClli());
54         assertEquals("3.0", site1.getCloudVersion());
55     }
56
57     /**
58      * This method implements a test for the getCloudSite method.
59      */
60     @Test
61     public final void testGetDefaultCloudSite() {
62         Optional<CloudSite> site = con.getCloudSite("NotThere");
63         assertTrue(site.isPresent());
64         CloudSite site1 = site.get();
65         assertEquals("NotThere", site1.getRegionId());
66         assertEquals("MDT13", site1.getClli());
67         assertEquals("NotThere", site1.getId());
68     }
69
70 }