2 * ============LICENSE_START=======================================================
\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
13 * http://www.apache.org/licenses/LICENSE-2.0
\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
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 * ============LICENSE_END=========================================================
\r
25 package org.onap.appc.adapter.iaas.impl;
\r
27 import java.util.Properties;
\r
28 import org.junit.Assert;
\r
29 import org.junit.Test;
\r
31 public class TestServiceCatalogFactory {
\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
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
47 url = "http://192.168.1.1:5000/v2/";
\r
48 catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential, domain,
\r
50 Assert.assertNotNull(catalog);
\r
51 Assert.assertEquals(catalog.getClass(), ServiceCatalogV2.class);
\r
53 url = "http://192.168.1.1:5000/v2.1/";
\r
54 catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential, domain,
\r
56 Assert.assertNotNull(catalog);
\r
57 Assert.assertEquals(catalog.getClass(), ServiceCatalogV2.class);
\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
72 Assert.assertNotNull(catalog);
\r
73 Assert.assertEquals(catalog.getClass(), ServiceCatalogV3.class);
\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
87 Assert.assertNull(catalog);
\r