2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 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.aai.audit;
23 import org.junit.Assert;
24 import org.junit.Before;
25 import org.junit.Test;
26 import org.onap.aai.AAISetup;
27 import org.onap.aai.setup.SchemaVersion;
29 import java.util.List;
31 import java.util.Properties;
33 public class ListEndpointsTest extends AAISetup {
35 private Properties properties;
36 private SchemaVersion version;
37 private ListEndpoints listEndpoints;
41 properties = new Properties();
42 version = schemaVersions.getDefaultVersion();
43 listEndpoints = new ListEndpoints(basePath, schemaVersions.getDefaultVersion());
47 public void testGetEndpoints() {
48 Assert.assertNotNull(listEndpoints);
49 List<String> list = listEndpoints.getEndpoints();
50 Assert.assertTrue(list != null && !list.isEmpty());
52 for (String endpoint : list) {
53 System.out.println("endpoints: " + endpoint);
58 public void testGetEndpointsWithParam() {
59 Assert.assertNotNull(listEndpoints);
60 List<String> list = listEndpoints.getEndpoints();
61 Assert.assertTrue(list != null && !list.isEmpty());
64 @Test(expected = RuntimeException.class)
65 public void testGetEndpoints_throwException() {
66 new ListEndpoints(basePath, null);
70 public void testGetLogicalNames() {
71 Assert.assertNotNull(listEndpoints);
72 Map<String, String> map = listEndpoints.getLogicalNames();
73 Assert.assertTrue(map != null && !map.isEmpty());
77 public void testToStrinWithParam() {
78 Assert.assertNotNull(listEndpoints);
79 String endpoints = listEndpoints.toString("complex");
80 Assert.assertTrue(!endpoints.contains("complex"));