First part of onap rename
[appc.git] / appc-adapters / appc-iaas-adapter / appc-iaas-adapter-bundle / src / test / java / org / onap / appc / adapter / iaas / impl / TestServiceCatalogFactory.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP : APPC\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Copyright (C) 2017 Amdocs\r
8  * =============================================================================\r
9  * Licensed under the Apache License, Version 2.0 (the "License");\r
10  * you may not use this file except in compliance with the License.\r
11  * You may obtain a copy of the License at\r
12  * \r
13  *      http://www.apache.org/licenses/LICENSE-2.0\r
14  * \r
15  * Unless required by applicable law or agreed to in writing, software\r
16  * distributed under the License is distributed on an "AS IS" BASIS,\r
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
18  * See the License for the specific language governing permissions and\r
19  * limitations under the License.\r
20  * \r
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
22  * ============LICENSE_END=========================================================\r
23  */\r
24 \r
25 package org.onap.appc.adapter.iaas.impl;\r
26 \r
27 import java.util.Properties;\r
28 import org.junit.Assert;\r
29 import org.junit.Test;\r
30 \r
31 public class TestServiceCatalogFactory {\r
32 \r
33     @Test\r
34     public void testGetServiceCatalogV2() {\r
35         String tenantIdentifier = null;\r
36         String principal = null;\r
37         String credential = null;\r
38         String domain = null;\r
39         Properties properties = null;\r
40 \r
41         String url = "http://192.168.1.1:5000/v2.0/";\r
42         ServiceCatalog catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential,\r
43                 domain, properties);\r
44         Assert.assertNotNull(catalog);\r
45         Assert.assertEquals(catalog.getClass(), ServiceCatalogV2.class);\r
46 \r
47         url = "http://192.168.1.1:5000/v2/";\r
48         catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential, domain,\r
49                 properties);\r
50         Assert.assertNotNull(catalog);\r
51         Assert.assertEquals(catalog.getClass(), ServiceCatalogV2.class);\r
52 \r
53         url = "http://192.168.1.1:5000/v2.1/";\r
54         catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential, domain,\r
55                 properties);\r
56         Assert.assertNotNull(catalog);\r
57         Assert.assertEquals(catalog.getClass(), ServiceCatalogV2.class);\r
58 \r
59     }\r
60 \r
61     @Test\r
62     public void testGetServiceCatalogV3() {\r
63         String url = "http://192.168.1.1:5000/v3.0/";\r
64         String tenantIdentifier = null;\r
65         String principal = null;\r
66         String credential = null;\r
67         String domain = null;\r
68         Properties properties = null;\r
69         ServiceCatalog catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential,\r
70                 domain, properties);\r
71 \r
72         Assert.assertNotNull(catalog);\r
73         Assert.assertEquals(catalog.getClass(), ServiceCatalogV3.class);\r
74     }\r
75 \r
76     @Test\r
77     public void testGetServiceCatalogOther() {\r
78         String url = "http://192.168.1.1:5000/v4.0/";\r
79         String tenantIdentifier = null;\r
80         String principal = null;\r
81         String credential = null;\r
82         String domain = null;\r
83         Properties properties = null;\r
84         ServiceCatalog catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential,\r
85                 domain, properties);\r
86 \r
87         Assert.assertNull(catalog);\r
88     }\r
89 }\r