dcf295496c2a72e0358e769ff8a1e65d770a952f
[dcaegen2/collectors/datafile.git] /
1 /*
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
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.collectors.datafile.service;
22
23 import static org.junit.Assert.assertNotNull;
24 import static org.mockito.Mockito.mock;
25 import static org.mockito.Mockito.when;
26
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;
31
32 class AaiHttpClientImplTest {
33
34     private static AaiClientImpl testedObject;
35
36
37     @BeforeAll
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);
46
47         testedObject  = new AaiClientImpl(aaiHttpClientConfigurationMock);
48     }
49
50     @Test
51     public void getAaiHttpClientObject_shouldNotBeNull() {
52         assertNotNull(testedObject.getAaiHttpClient());
53     }
54 }
55