2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.cloud;
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;
35 * This class implements test methods of the CloudConfig features.
39 public class CloudConfigTest extends BaseTest {
42 private CloudConfig con;
45 * This method implements a test for the getCloudSite method.
48 public final void testGetCloudSite() {
49 CloudSite site1 = con.getCloudSite("MTN13").get();
51 assertEquals("mtn13", site1.getRegionId());
52 assertEquals("mtn13", site1.getIdentityServiceId());
53 assertEquals("MDT13", site1.getClli());
54 assertEquals("3.0", site1.getCloudVersion());
58 * This method implements a test for the getCloudSite method.
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());