2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017-2018 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 * ============LICENSE_END=========================================================
\r
24 package org.onap.appc.adapter.iaas.impl;
\r
26 import java.util.Properties;
\r
27 import org.junit.Assert;
\r
28 import org.junit.Test;
\r
30 public class TestServiceCatalogFactory {
\r
33 public void testGetServiceCatalogV2() {
\r
34 String tenantIdentifier = null;
\r
35 String principal = null;
\r
36 String credential = null;
\r
37 String domain = null;
\r
38 Properties properties = null;
\r
40 String url = "http://192.168.1.1:5000/v2.0/";
\r
41 ServiceCatalog catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential,
\r
42 domain, properties);
\r
43 Assert.assertNotNull(catalog);
\r
44 Assert.assertEquals(catalog.getClass(), ServiceCatalogV2.class);
\r
46 url = "http://192.168.1.1:5000/v2/";
\r
47 catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential, domain,
\r
49 Assert.assertNotNull(catalog);
\r
50 Assert.assertEquals(catalog.getClass(), ServiceCatalogV2.class);
\r
52 url = "http://192.168.1.1:5000/v2.1/";
\r
53 catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential, domain,
\r
55 Assert.assertNotNull(catalog);
\r
56 Assert.assertEquals(catalog.getClass(), ServiceCatalogV2.class);
\r
61 public void testGetServiceCatalogV3() {
\r
62 String url = "http://192.168.1.1:5000/v3.0/";
\r
63 String tenantIdentifier = null;
\r
64 String principal = null;
\r
65 String credential = null;
\r
66 String domain = null;
\r
67 Properties properties = null;
\r
68 ServiceCatalog catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential,
\r
69 domain, properties);
\r
71 Assert.assertNotNull(catalog);
\r
72 Assert.assertEquals(catalog.getClass(), ServiceCatalogV3.class);
\r
76 public void testGetServiceCatalogOther() {
\r
77 String url = "http://192.168.1.1:5000/v4.0/";
\r
78 String tenantIdentifier = null;
\r
79 String principal = null;
\r
80 String credential = null;
\r
81 String domain = null;
\r
82 Properties properties = null;
\r
83 ServiceCatalog catalog = ServiceCatalogFactory.getServiceCatalog(url, tenantIdentifier, principal, credential,
\r
84 domain, properties);
\r
86 Assert.assertNull(catalog);
\r