c282e1a7b20df4b2438f1992fa1bcb086fc0abcf
[ccsdk/features.git] /
1 /*
2  * ============LICENSE_START========================================================================
3  * ONAP : ccsdk feature sdnr wt
4  * =================================================================================================
5  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
6  * =================================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8  * in compliance with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software distributed under the License
13  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14  * or implied. See the License for the specific language governing permissions and limitations under
15  * the License.
16  * ============LICENSE_END==========================================================================
17  */
18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.test;
19
20 import static org.mockito.Mockito.mock;
21 import static org.mockito.Mockito.when;
22 import java.lang.reflect.Constructor;
23 import java.util.Arrays;
24 import java.util.List;
25 import org.eclipse.jdt.annotation.NonNull;
26 import org.junit.Before;
27 import org.junit.Test;
28 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.WrapperMicrowaveModelRev181010;
29 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName;
30 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
31 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
32 import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
33 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
34 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
35 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapperHelper;
36 import org.onap.ccsdk.features.sdnr.wt.yang.mapper.mapperextensions.YangtoolsMapDesirializer;
37 import org.opendaylight.mdsal.binding.api.DataBroker;
38 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
39 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.Yang;
40 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
41 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
42 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.LpBuilder;
43 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.GranularityPeriodType;
44 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfaceDiversityPac;
45 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfaceDiversityPacKey;
46 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfacePac;
47 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwAirInterfacePacKey;
48 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwEthernetContainerPac;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwEthernetContainerPacKey;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwHybridMwStructurePac;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwHybridMwStructurePacKey;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwPureEthernetStructurePac;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwPureEthernetStructurePacKey;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwTdmContainerPac;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.MwTdmContainerPacKey;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.SeverityType;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.current.problems.g.CurrentProblemList;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.current.problems.g.CurrentProblemListBuilder;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.historical.performance.type.g.PerformanceData;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.historical.performance.type.g.PerformanceDataBuilder;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblemsBuilder;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceConfiguration;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceConfigurationBuilder;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceCurrentProblems;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceCurrentProblemsBuilder;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.air._interface.pac.AirInterfaceHistoricalPerformancesBuilder;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.ethernet.container.pac.EthernetContainerCurrentProblemsBuilder;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
72 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.ethernet.container.pac.EthernetContainerHistoricalPerformancesBuilder;
73 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
74 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblemsBuilder;
75 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
76 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblemsBuilder;
77 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.tdm.container.pac.TdmContainerCurrentProblems;
78 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.mw.tdm.container.pac.TdmContainerCurrentProblemsBuilder;
79 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
80 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
81
82 @SuppressWarnings("deprecation")
83 public class TestWrapperMicrowaveModelRev181010 {
84
85     NetconfBindingAccessor accessor;
86     DeviceManagerServiceProvider serviceProvider;
87     FaultData resultList;
88     UniversalId uid;
89     TransactionUtils transactionUtils;
90     DataBroker dataBroker;
91
92     InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID;
93     @NonNull
94     AirInterfaceCurrentProblems airInterfaceCurrentProblems;
95
96     InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID;
97     @NonNull
98     EthernetContainerCurrentProblems ethernetContainerCurrentProblems;
99
100     @Before
101     public void init() {
102         accessor = mock(NetconfBindingAccessor.class);
103         serviceProvider = mock(DeviceManagerServiceProvider.class);
104         resultList = mock(FaultData.class);
105         transactionUtils = mock(TransactionUtils.class);
106         dataBroker = mock(DataBroker.class);
107
108         uid = new UniversalId("ABCD");
109
110         mwAirInterfaceIID = InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid))
111                 .child(AirInterfaceCurrentProblems.class).build();
112         List<CurrentProblemList> currentProblemList =
113                 Arrays.asList(new CurrentProblemListBuilder().setProblemName("Loss of Signal")
114                         .setProblemSeverity(SeverityType.Critical).setSequenceNumber(1).setTimeStamp(null).build());
115         airInterfaceCurrentProblems =
116                 new AirInterfaceCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
117
118         mwEthInterfaceIID = InstanceIdentifier.builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(uid))
119                 .child(EthernetContainerCurrentProblems.class).build();
120         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ethernet.container.current.problems.g.CurrentProblemList> ethCurrentProblemsList =
121                 Arrays.asList(
122                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ethernet.container.current.problems.g.CurrentProblemListBuilder()
123                                 .setProblemName("Link Negotiation Unsuccessful")
124                                 .setProblemSeverity(SeverityType.Critical).setSequenceNumber(1).setTimeStamp(null)
125                                 .build());
126         ethernetContainerCurrentProblems =
127                 new EthernetContainerCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(ethCurrentProblemsList)).build();
128
129         NodeId nNodeId = new NodeId("nSky");
130         when(accessor.getNodeId()).thenReturn(nNodeId);
131         when(accessor.getTransactionUtils()).thenReturn(transactionUtils);
132         when(accessor.getDataBroker()).thenReturn(dataBroker);
133
134     }
135
136     @Test
137     public void testMWAirInterfaceWithProblems() {
138         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
139                 mwAirInterfaceIID)).thenReturn(airInterfaceCurrentProblems);
140
141         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
142                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
143         wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid,
144                 resultList);
145     }
146
147     @Test
148     public void testMWAirInterfaceWithoProblems() {
149         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
150                 mwAirInterfaceIID)).thenReturn(null);
151
152         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
153                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
154         wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid,
155                 resultList);
156     }
157
158     @Test
159     public void testEthernetContainer12WithProblems() {
160         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
161                 mwEthInterfaceIID)).thenReturn(ethernetContainerCurrentProblems);
162
163         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
164                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
165         wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null,
166                 uid, resultList);
167     }
168
169     @Test
170     public void testEthernetContainer12WithNoProblems() {
171         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
172                 mwEthInterfaceIID)).thenReturn(null);
173
174         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
175                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
176         wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null,
177                 uid, resultList);
178     }
179
180     @Test
181     public void testTdmContainer12WithProblems() throws Exception {
182         final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
183         final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
184         final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
185
186         Constructor<MwTdmContainerPacKey> cons = clazzPacKey.getConstructor(UniversalId.class); // Avoid new()
187         InstanceIdentifier<TdmContainerCurrentProblems> mwEthInterfaceIID =
188                 InstanceIdentifier.builder(clazzPac, cons.newInstance(uid)).child(clazzProblems).build();
189
190         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.tdm.container.current.problems.g.CurrentProblemList> currentProblemList =
191                 Arrays.asList(
192                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.tdm.container.current.problems.g.CurrentProblemListBuilder()
193                                 .setProblemName("Loss of Payload").setProblemSeverity(SeverityType.Major)
194                                 .setSequenceNumber(2).setTimeStamp(null).build());
195         TdmContainerCurrentProblems tdmInterfaceCurrentProblems =
196                 new TdmContainerCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
197         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
198                 mwEthInterfaceIID)).thenReturn(tdmInterfaceCurrentProblems);
199
200         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
201                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
202         wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.TDMCONTAINER, null, uid,
203                 resultList);
204
205     }
206
207     @Test
208     public void testMwHybridMwStructureWithProblems() throws Exception {
209         final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
210         final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
211
212         InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID =
213                 InstanceIdentifier.builder(clazzPac, new MwHybridMwStructurePacKey(uid)).child(clazzProblems).build();
214
215         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.hybrid.mw.structure.current.problems.g.CurrentProblemList> currentProblemList =
216                 Arrays.asList(
217                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.hybrid.mw.structure.current.problems.g.CurrentProblemListBuilder()
218                                 .setProblemName("Loss of Payload").setProblemSeverity(SeverityType.Major)
219                                 .setSequenceNumber(2).setTimeStamp(null).build());
220         HybridMwStructureCurrentProblems hybridMwStructureCurrentProblems =
221                 new HybridMwStructureCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
222         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
223                 mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems);
224
225         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
226                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
227         wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE,
228                 MwHybridMwStructurePac.class, uid, resultList);
229
230     }
231
232     @Test
233     public void testMwAirInterfaceDiversityStructureWithProblems() throws Exception {
234         final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
235         final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
236
237         InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
238                 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(uid)).child(clazzProblems).build();
239
240         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.diversity.current.problems.g.CurrentProblemList> currentProblemList =
241                 Arrays.asList(
242                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.diversity.current.problems.g.CurrentProblemListBuilder()
243                                 .setProblemName("Loss of Payload").setProblemSeverity(SeverityType.Major)
244                                 .setSequenceNumber(2).setTimeStamp(null).build());
245         AirInterfaceDiversityCurrentProblems hybridMwStructureCurrentProblems =
246                 new AirInterfaceDiversityCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
247         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
248                 mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems);
249
250         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
251                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
252         wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE,
253                 MwAirInterfaceDiversityPac.class, uid, resultList);
254
255     }
256
257     @Test
258     public void testMwPureEthernetStructureWithProblems() throws Exception {
259         final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
260         final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
261
262         InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
263                 .builder(clazzPac, new MwPureEthernetStructurePacKey(uid)).child(clazzProblems).build();
264
265         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.pure.ethernet.structure.current.problems.g.CurrentProblemList> currentProblemList =
266                 Arrays.asList(
267                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.pure.ethernet.structure.current.problems.g.CurrentProblemListBuilder()
268                                 .setProblemName("Loss of Payload").setProblemSeverity(SeverityType.Major)
269                                 .setSequenceNumber(2).setTimeStamp(null).build());
270         PureEthernetStructureCurrentProblems hybridMwStructureCurrentProblems =
271                 new PureEthernetStructureCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
272         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
273                 mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems);
274
275         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
276                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
277         wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE,
278                 MwPureEthernetStructurePac.class, uid, resultList);
279
280     }
281
282     @Test
283     public void testNullStructureWithProblems() throws Exception {
284
285         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
286                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
287         wrapperMicrowaveModelRev181010.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, null, uid,
288                 resultList);
289
290     }
291
292     @Test
293     public void testgetLtpHistoricalPerformanceData() throws InconsistentPMDataException {
294         InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID =
295                 InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid))
296                         .child(AirInterfaceConfiguration.class).build();
297
298         AirInterfaceConfiguration airConfiguration = new AirInterfaceConfigurationBuilder().build();
299         when(accessor.getTransactionUtils().readData(dataBroker, LogicalDatastoreType.OPERATIONAL,
300                 mwAirInterfaceConfigurationIID)).thenReturn(airConfiguration);
301
302         InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID =
303                 InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid))
304                         .child(AirInterfaceHistoricalPerformances.class).build();
305
306         PerformanceData performanceData = new PerformanceDataBuilder().build();
307         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList =
308                 Arrays.asList(
309                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.air._interface.historical.performances.g.HistoricalPerformanceDataListBuilder()
310                         .setHistoryDataId("123")
311                         .setGranularityPeriod(GranularityPeriodType.Period15Min)
312                         .setSuspectIntervalFlag(true)
313                                 .setPerformanceData(performanceData).build());
314         AirInterfaceHistoricalPerformances airHistoricalPerformanceData =
315                 new AirInterfaceHistoricalPerformancesBuilder().setHistoricalPerformanceDataList(YangToolsMapperHelper.toMap(airHistPMList)).build();
316         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
317                 mwAirInterfaceHistoricalPerformanceIID)).thenReturn(airHistoricalPerformanceData);
318
319         InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID =
320                 InstanceIdentifier.builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(uid))
321                         .child(EthernetContainerHistoricalPerformances.class).build();
322
323         org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.container.historical.performance.type.g.PerformanceData ethPerformanceData =
324                 new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.container.historical.performance.type.g.PerformanceDataBuilder()
325                         .build();
326         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> ethHistPMList =
327                 Arrays.asList(
328                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.ethernet.container.historical.performances.g.HistoricalPerformanceDataListBuilder()
329                         .setHistoryDataId("123")
330                         .setGranularityPeriod(GranularityPeriodType.Period24Hours)
331                         .setSuspectIntervalFlag(true)
332                                 .setPerformanceData(ethPerformanceData).build());
333         EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData =
334                 new EthernetContainerHistoricalPerformancesBuilder().setHistoricalPerformanceDataList(YangToolsMapperHelper.toMap(ethHistPMList))
335                         .build();
336         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
337                 ethContainerIID)).thenReturn(ethContainerHistoricalPerformanceData);
338
339         Lp lp = new LpBuilder().setUuid(uid).build();
340         WrapperMicrowaveModelRev181010 wrapperMicrowaveModelRev181010 =
341                 new WrapperMicrowaveModelRev181010(accessor, serviceProvider);
342
343         wrapperMicrowaveModelRev181010.getLtpHistoricalPerformanceData(ONFLayerProtocolName.MWAIRINTERFACE, lp);
344     }
345 }