2  * ============LICENSE_START=======================================================
 
   3  * ONAP : ccsdk features
 
   4  * ================================================================================
 
   5  * Copyright (C) 2022 highstreet technologies GmbH Intellectual Property.
 
   7  * ================================================================================
 
   8  * Licensed under the Apache License, Version 2.0 (the "License");
 
   9  * you may not use this file except in compliance with the License.
 
  10  * You may obtain a copy of the License at
 
  12  *     http://www.apache.org/licenses/LICENSE-2.0
 
  14  * Unless required by applicable law or agreed to in writing, software
 
  15  * distributed under the License is distributed on an "AS IS" BASIS,
 
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  17  * See the License for the specific language governing permissions and
 
  18  * limitations under the License.
 
  19  * ============LICENSE_END=========================================================
 
  22 package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom;
 
  24 import static org.mockito.Mockito.mock;
 
  25 import static org.mockito.Mockito.when;
 
  26 import java.io.IOException;
 
  27 import java.net.URISyntaxException;
 
  28 import java.util.Optional;
 
  29 import javax.xml.stream.XMLStreamException;
 
  30 import org.junit.Test;
 
  31 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.interfaces.Onf14DomInterfacePacManager;
 
  32 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames;
 
  33 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.util.Onf14DomTestUtils;
 
  34 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
 
  35 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 
  36 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 
  37 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
  38 import org.xml.sax.SAXException;
 
  40 public class TestOnf14DomInterfacePacManager {
 
  43     public void test() throws XMLStreamException, URISyntaxException, IOException, SAXException {
 
  44         NetconfDomAccessor netconfDomAccessor = mock(NetconfDomAccessor.class);
 
  45         Onf14DomInterfacePacManager interfacePacMgr = mock(Onf14DomInterfacePacManager.class);
 
  46         ContainerNode cn = (ContainerNode) Onf14DomTestUtils.getNormalizedNodeFromXML();
 
  47         NormalizedNode ltpData = cn.getChildByArg(new NodeIdentifier(Onf14DevicemanagerQNames.CORE_MODEL_CC_LTP));
 
  48         when(interfacePacMgr.readLtpData(netconfDomAccessor)).thenReturn(Optional.of(ltpData));
 
  49         interfacePacMgr.register();