2 * ============LICENSE_START=======================================================
3 * Datafile Collector Service
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.collectors.datafile.service;
23 import static org.junit.Assert.assertNotNull;
24 import static org.mockito.Mockito.mock;
25 import static org.mockito.Mockito.when;
27 import org.junit.jupiter.api.BeforeAll;
28 import org.junit.jupiter.api.Test;
29 import org.onap.dcaegen2.collectors.datafile.config.AaiClientConfiguration;
30 import org.onap.dcaegen2.collectors.datafile.service.AaiClientImpl;
32 class AaiHttpClientImplTest {
34 private static AaiClientImpl testedObject;
38 public static void setup() {
39 AaiClientConfiguration aaiHttpClientConfigurationMock = mock(AaiClientConfiguration.class);
40 when(aaiHttpClientConfigurationMock.aaiHost()).thenReturn("54.45.33.2");
41 when(aaiHttpClientConfigurationMock.aaiProtocol()).thenReturn("https");
42 when(aaiHttpClientConfigurationMock.aaiPort()).thenReturn(1234);
43 when(aaiHttpClientConfigurationMock.aaiUserName()).thenReturn("PNF");
44 when(aaiHttpClientConfigurationMock.aaiUserPassword()).thenReturn("PNF");
45 when(aaiHttpClientConfigurationMock.aaiIgnoreSslCertificateErrors()).thenReturn(true);
47 testedObject = new AaiClientImpl(aaiHttpClientConfigurationMock);
51 public void getAaiHttpClientObject_shouldNotBeNull() {
52 assertNotNull(testedObject.getAaiHttpClient());