2 * ============LICENSE_START=======================================================
3 * PNF-REGISTRATION-HANDLER
4 * ================================================================================
5 * Copyright (C) 2018 NOKIA 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.dcaegen2.services.service.config;
23 import org.junit.jupiter.api.Assertions;
24 import org.junit.jupiter.api.BeforeAll;
25 import org.junit.jupiter.api.Test;
26 import org.onap.dcaegen2.services.config.AAIHttpClientConfiguration;
27 import org.onap.dcaegen2.services.config.ImmutableAAIHttpClientConfiguration;
29 public class AAIHttpClientConfigurationTest {
31 private static AAIHttpClientConfiguration client;
32 private static final String AAI_HOST = "/aai/v11/network/pnfs/pnf/NOKQTFCOC540002E";
33 private static final Integer PORT = 1234;
34 private static final String PROTOCOL = "https";
35 private static final String USER_NAME_PASSWORD = "PRH";
38 public static void init() {
39 client = ImmutableAAIHttpClientConfiguration.builder()
41 .aaiHostPortNumber(PORT)
42 .aaiProtocol(PROTOCOL)
43 .aaiUserName(USER_NAME_PASSWORD)
44 .aaiUserPassword(USER_NAME_PASSWORD)
45 .aaiIgnoreSSLCertificateErrors(true)
50 public void testGetters_success() {
51 Assertions.assertEquals(AAI_HOST,client.aaiHost());
52 Assertions.assertEquals(PORT, client.aaiHostPortNumber());
53 Assertions.assertEquals(PROTOCOL,client.aaiProtocol());
54 Assertions.assertEquals(USER_NAME_PASSWORD, client.aaiUserName());
55 Assertions.assertEquals(USER_NAME_PASSWORD, client.aaiUserPassword());
56 Assertions.assertEquals(true, client.aaiIgnoreSSLCertificateErrors());