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.pnfsimulator.netconfmonitor;
23 import static org.junit.jupiter.api.Assertions.assertNotNull;
24 import static org.mockito.ArgumentMatchers.any;
25 import static org.mockito.Mockito.doReturn;
26 import static org.mockito.Mockito.mock;
27 import static org.mockito.Mockito.spy;
28 import static org.mockito.Mockito.verify;
30 import com.tailf.jnc.JNCException;
31 import com.tailf.jnc.NetconfSession;
32 import java.io.IOException;
33 import org.junit.jupiter.api.BeforeEach;
34 import org.junit.jupiter.api.Test;
35 import org.mockito.Mock;
37 class NetconfMonitorServiceConfigurationTest {
39 private NetconfMonitorServiceConfiguration configuration;
42 private NetconfSession netconfSession;
46 netconfSession = mock(NetconfSession.class);
47 configuration = spy(new NetconfMonitorServiceConfiguration());
51 void readNetconfConfiguration() throws IOException, JNCException {
52 doReturn(netconfSession).when(configuration).createNetconfSession(any());
54 assertNotNull(configuration.configurationReader());
55 verify(configuration).createNetconfSession(any());
59 void configurationCacheIsNotNull() {
60 assertNotNull(configuration.configurationCache());
64 void netconfConfigurationWriterIsNotNull() {
65 assertNotNull(configuration.netconfConfigurationWriter());
69 void timerIsNotNull() {
70 assertNotNull(configuration.timer());