a759aca51e054d447b598de45b93a05c7e0f33b7
[dcaegen2/services/prh.git] /
1 /*-
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.dcaegen2.services.service.config;
22
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;
28
29 public class AAIHttpClientConfigurationTest {
30
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";
36
37     @BeforeAll
38     public static void init() {
39         client = ImmutableAAIHttpClientConfiguration.builder()
40                 .aaiHost(AAI_HOST)
41                 .aaiHostPortNumber(PORT)
42                 .aaiProtocol(PROTOCOL)
43                 .aaiUserName(USER_NAME_PASSWORD)
44                 .aaiUserPassword(USER_NAME_PASSWORD)
45                 .aaiIgnoreSSLCertificateErrors(true)
46                 .build();
47     }
48
49     @Test
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());
57     }
58 }