2 * ===============================LICENSE_START======================================
4 * ================================================================================
5 * Copyright © 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.dcae.apod.analytics.aai.it;
23 import org.onap.dcae.apod.analytics.aai.domain.config.AAIHttpClientConfig;
24 import org.onap.dcae.apod.analytics.aai.domain.config.AAIHttpClientConfigBuilder;
25 import org.onap.dcae.apod.analytics.test.BaseDCAEAnalyticsIT;
27 import java.net.MalformedURLException;
29 import java.util.LinkedHashMap;
33 * @author Rajiv Singla . Creation Date: 9/18/2017.
35 public abstract class BaseAnalyticsAAIIT extends BaseDCAEAnalyticsIT {
37 protected static final String AAI_HOST_NAME = "1.2.3.4";
38 protected static final Integer AAI_HOST_PORT_NUMBER = 1234;
39 protected static final String AAI_HOST_PROTOCOL = "https";
40 protected static final String AAI_VNF_ENRICHMENT_PATH = "/aai/v11/network/generic-vnfs/generic-vnf";
41 protected static final String AAI_VSERVER_NODE_QUERY_PATH = "/aai/v11/search/nodes-query";
42 protected static final Map<String, String> AAI_HEADERS = new LinkedHashMap<>();
45 protected static final String AAI_VSERVER_QUERY_RESPONSE_LOCATION = "data/json/aai/aai_vserver_resource_data.json";
48 AAI_HEADERS.put("X-FromAppId", "vv-temp");
49 AAI_HEADERS.put("X-TransactionId", "vv-temp");
50 AAI_HEADERS.put("Accept", "application/json");
51 AAI_HEADERS.put("Real-Time", "true");
52 AAI_HEADERS.put("Content-Type", "application/json");
55 protected static final String AAI_USER_NAME = "DCAE";
56 protected static final String AAI_USER_PASSWORD = "DCAE";
57 protected static final boolean IGNORE_SSL_CERTIFICATE_ERRORS = true;
60 protected AAIHttpClientConfig getAAIHttpClientConfig() {
62 URL proxyURL = new URL("http://username:password@proxy.att.com:80");
63 return new AAIHttpClientConfigBuilder(AAI_HOST_NAME)
64 .setAaiProtocol(AAI_HOST_PROTOCOL)
65 .setAaiHostPortNumber(AAI_HOST_PORT_NUMBER)
66 .setAaiUserName(AAI_USER_NAME)
67 .setAaiUserPassword(AAI_USER_PASSWORD)
68 .setAaiProxyURL(proxyURL)
69 .setAaiIgnoreSSLCertificateErrors(IGNORE_SSL_CERTIFICATE_ERRORS).build();
70 } catch (MalformedURLException e) {
71 throw new IllegalArgumentException(e);