173b973b9d68a9e2f0a549e697f26a678a5ec83a
[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.WrapperMicrowaveModelRev180907;
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.opendaylight.mdsal.common.api.LogicalDatastoreType;
37 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
38 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
39 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.LpBuilder;
40 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.GranularityPeriodType;
41 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfaceDiversityPac;
42 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfaceDiversityPacKey;
43 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfacePac;
44 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwAirInterfacePacKey;
45 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwEthernetContainerPac;
46 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwEthernetContainerPacKey;
47 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwHybridMwStructurePac;
48 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwHybridMwStructurePacKey;
49 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwPureEthernetStructurePac;
50 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwPureEthernetStructurePacKey;
51 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwTdmContainerPac;
52 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.MwTdmContainerPacKey;
53 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.SeverityType;
54 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.current.problems.g.CurrentProblemList;
55 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.current.problems.g.CurrentProblemListBuilder;
56 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.historical.performance.type.g.PerformanceData;
57 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.historical.performance.type.g.PerformanceDataBuilder;
58 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblems;
59 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.diversity.pac.AirInterfaceDiversityCurrentProblemsBuilder;
60 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceConfiguration;
61 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceConfigurationBuilder;
62 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceCurrentProblems;
63 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceCurrentProblemsBuilder;
64 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceHistoricalPerformances;
65 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.air._interface.pac.AirInterfaceHistoricalPerformancesBuilder;
66 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerCurrentProblems;
67 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerCurrentProblemsBuilder;
68 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerHistoricalPerformances;
69 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.ethernet.container.pac.EthernetContainerHistoricalPerformancesBuilder;
70 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblems;
71 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.hybrid.mw.structure.pac.HybridMwStructureCurrentProblemsBuilder;
72 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblems;
73 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.pure.ethernet.structure.pac.PureEthernetStructureCurrentProblemsBuilder;
74 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.tdm.container.pac.TdmContainerCurrentProblems;
75 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.mw.tdm.container.pac.TdmContainerCurrentProblemsBuilder;
76 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
77 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
78
79 public class TestWrapperMicrowaveModelRev180907 {
80
81     NetconfBindingAccessor accessor;
82     DeviceManagerServiceProvider serviceProvider;
83     FaultData resultList;
84     UniversalId uid;
85     TransactionUtils transactionUtils;
86
87     InstanceIdentifier<AirInterfaceCurrentProblems> mwAirInterfaceIID;
88     @NonNull
89     AirInterfaceCurrentProblems airInterfaceCurrentProblems;
90
91     InstanceIdentifier<EthernetContainerCurrentProblems> mwEthInterfaceIID;
92     @NonNull
93     EthernetContainerCurrentProblems ethernetContainerCurrentProblems;
94
95     @Before
96     public void init() {
97         accessor = mock(NetconfBindingAccessor.class);
98         serviceProvider = mock(DeviceManagerServiceProvider.class);
99         resultList = mock(FaultData.class);
100         transactionUtils = mock(TransactionUtils.class);
101
102         uid = new UniversalId("ABCD");
103
104         mwAirInterfaceIID = InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid))
105                 .child(AirInterfaceCurrentProblems.class).build();
106         List<CurrentProblemList> currentProblemList =
107                 Arrays.asList(new CurrentProblemListBuilder().setProblemName("Loss of Signal")
108                         .setProblemSeverity(SeverityType.Critical).setSequenceNumber(1).setTimeStamp(null).build());
109         airInterfaceCurrentProblems =
110                 new AirInterfaceCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
111
112         mwEthInterfaceIID = InstanceIdentifier.builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(uid))
113                 .child(EthernetContainerCurrentProblems.class).build();
114         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ethernet.container.current.problems.g.CurrentProblemList> ethCurrentProblemsList =
115                 Arrays.asList(
116                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ethernet.container.current.problems.g.CurrentProblemListBuilder()
117                                 .setProblemName("Link Negotiation Unsuccessful")
118                                 .setProblemSeverity(SeverityType.Critical).setSequenceNumber(1).setTimeStamp(null)
119                                 .build());
120         ethernetContainerCurrentProblems =
121                 new EthernetContainerCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(ethCurrentProblemsList)).build();
122
123         NodeId nNodeId = new NodeId("nSky");
124         when(accessor.getNodeId()).thenReturn(nNodeId);
125         when(accessor.getTransactionUtils()).thenReturn(transactionUtils);
126
127     }
128
129     @Test
130     public void testMWAirInterfaceWithProblems() {
131         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
132                 mwAirInterfaceIID)).thenReturn(airInterfaceCurrentProblems);
133
134         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
135                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
136         wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid,
137                 resultList);
138     }
139
140     @Test
141     public void testMWAirInterfaceWithoProblems() {
142         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
143                 mwAirInterfaceIID)).thenReturn(null);
144
145         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
146                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
147         wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.MWAIRINTERFACE, null, uid,
148                 resultList);
149     }
150
151     @Test
152     public void testEthernetContainer12WithProblems() {
153         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
154                 mwEthInterfaceIID)).thenReturn(ethernetContainerCurrentProblems);
155
156         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
157                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
158         wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null,
159                 uid, resultList);
160     }
161
162     @Test
163     public void testEthernetContainer12WithNoProblems() {
164         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
165                 mwEthInterfaceIID)).thenReturn(null);
166
167         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
168                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
169         wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.ETHERNETCONTAINER12, null,
170                 uid, resultList);
171     }
172
173     @Test
174     public void testTdmContainer12WithProblems() throws Exception {
175         final Class<MwTdmContainerPac> clazzPac = MwTdmContainerPac.class;
176         final Class<MwTdmContainerPacKey> clazzPacKey = MwTdmContainerPacKey.class;
177         final Class<TdmContainerCurrentProblems> clazzProblems = TdmContainerCurrentProblems.class;
178
179         Constructor<MwTdmContainerPacKey> cons = clazzPacKey.getConstructor(UniversalId.class); // Avoid new()
180         InstanceIdentifier<TdmContainerCurrentProblems> mwEthInterfaceIID =
181                 InstanceIdentifier.builder(clazzPac, cons.newInstance(uid)).child(clazzProblems).build();
182
183         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.tdm.container.current.problems.g.CurrentProblemList> currentProblemList =
184                 Arrays.asList(
185                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.tdm.container.current.problems.g.CurrentProblemListBuilder()
186                                 .setProblemName("Loss of Payload").setProblemSeverity(SeverityType.Major)
187                                 .setSequenceNumber(2).setTimeStamp(null).build());
188         TdmContainerCurrentProblems tdmInterfaceCurrentProblems =
189                 new TdmContainerCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
190         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
191                 mwEthInterfaceIID)).thenReturn(tdmInterfaceCurrentProblems);
192
193         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
194                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
195         wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.TDMCONTAINER, null, uid,
196                 resultList);
197
198     }
199
200     @Test
201     public void testMwHybridMwStructureWithProblems() throws Exception {
202         final Class<MwHybridMwStructurePac> clazzPac = MwHybridMwStructurePac.class;
203         final Class<HybridMwStructureCurrentProblems> clazzProblems = HybridMwStructureCurrentProblems.class;
204
205         InstanceIdentifier<HybridMwStructureCurrentProblems> mwEthInterfaceIID =
206                 InstanceIdentifier.builder(clazzPac, new MwHybridMwStructurePacKey(uid)).child(clazzProblems).build();
207
208         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.hybrid.mw.structure.current.problems.g.CurrentProblemList> currentProblemList =
209                 Arrays.asList(
210                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.hybrid.mw.structure.current.problems.g.CurrentProblemListBuilder()
211                                 .setProblemName("Loss of Payload").setProblemSeverity(SeverityType.Major)
212                                 .setSequenceNumber(2).setTimeStamp(null).build());
213         HybridMwStructureCurrentProblems hybridMwStructureCurrentProblems =
214                 new HybridMwStructureCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
215         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
216                 mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems);
217
218         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
219                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
220         wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE,
221                 MwHybridMwStructurePac.class, uid, resultList);
222
223     }
224
225     @Test
226     public void testMwAirInterfaceDiversityStructureWithProblems() throws Exception {
227         final Class<MwAirInterfaceDiversityPac> clazzPac = MwAirInterfaceDiversityPac.class;
228         final Class<AirInterfaceDiversityCurrentProblems> clazzProblems = AirInterfaceDiversityCurrentProblems.class;
229
230         InstanceIdentifier<AirInterfaceDiversityCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
231                 .builder(clazzPac, new MwAirInterfaceDiversityPacKey(uid)).child(clazzProblems).build();
232
233         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.diversity.current.problems.g.CurrentProblemList> currentProblemList =
234                 Arrays.asList(
235                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.diversity.current.problems.g.CurrentProblemListBuilder()
236                                 .setProblemName("Loss of Payload").setProblemSeverity(SeverityType.Major)
237                                 .setSequenceNumber(2).setTimeStamp(null).build());
238         AirInterfaceDiversityCurrentProblems hybridMwStructureCurrentProblems =
239                 new AirInterfaceDiversityCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
240         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
241                 mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems);
242
243         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
244                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
245         wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE,
246                 MwAirInterfaceDiversityPac.class, uid, resultList);
247
248     }
249
250     @Test
251     public void testMwPureEthernetStructureWithProblems() throws Exception {
252         final Class<MwPureEthernetStructurePac> clazzPac = MwPureEthernetStructurePac.class;
253         final Class<PureEthernetStructureCurrentProblems> clazzProblems = PureEthernetStructureCurrentProblems.class;
254
255         InstanceIdentifier<PureEthernetStructureCurrentProblems> mwEthInterfaceIID = InstanceIdentifier
256                 .builder(clazzPac, new MwPureEthernetStructurePacKey(uid)).child(clazzProblems).build();
257
258         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.pure.ethernet.structure.current.problems.g.CurrentProblemList> currentProblemList =
259                 Arrays.asList(
260                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.pure.ethernet.structure.current.problems.g.CurrentProblemListBuilder()
261                                 .setProblemName("Loss of Payload").setProblemSeverity(SeverityType.Major)
262                                 .setSequenceNumber(2).setTimeStamp(null).build());
263         PureEthernetStructureCurrentProblems hybridMwStructureCurrentProblems =
264                 new PureEthernetStructureCurrentProblemsBuilder().setCurrentProblemList(YangToolsMapperHelper.toMap(currentProblemList)).build();
265         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
266                 mwEthInterfaceIID)).thenReturn(hybridMwStructureCurrentProblems);
267
268         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
269                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
270         wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE,
271                 MwPureEthernetStructurePac.class, uid, resultList);
272
273     }
274
275     @Test
276     public void testNullStructureWithProblems() throws Exception {
277
278         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
279                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
280         wrapperMicrowaveModelRev180907.readTheFaultsOfMicrowaveModel(ONFLayerProtocolName.STRUCTURE, null, uid,
281                 resultList);
282
283     }
284
285     @Test
286     public void testgetLtpHistoricalPerformanceData() throws InconsistentPMDataException {
287         InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID =
288                 InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid))
289                         .child(AirInterfaceConfiguration.class).build();
290
291         AirInterfaceConfiguration airConfiguration =
292                 new AirInterfaceConfigurationBuilder().setAirInterfaceName("TESTINTF").build();
293         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
294                 mwAirInterfaceConfigurationIID)).thenReturn(airConfiguration);
295
296         InstanceIdentifier<AirInterfaceHistoricalPerformances> mwAirInterfaceHistoricalPerformanceIID =
297                 InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid))
298                         .child(AirInterfaceHistoricalPerformances.class).build();
299
300         PerformanceData performanceData = new PerformanceDataBuilder().build();
301         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.historical.performances.g.HistoricalPerformanceDataList> airHistPMList =
302                 Arrays.asList(
303                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.air._interface.historical.performances.g.HistoricalPerformanceDataListBuilder()
304                         .setHistoryDataId("123")
305                         .setGranularityPeriod(GranularityPeriodType.Period15Min)
306                         .setSuspectIntervalFlag(true)
307                                 .setPerformanceData(performanceData).build());
308         AirInterfaceHistoricalPerformances airHistoricalPerformanceData =
309                 new AirInterfaceHistoricalPerformancesBuilder().setHistoricalPerformanceDataList(YangToolsMapperHelper.toMap(airHistPMList)).build();
310         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
311                 mwAirInterfaceHistoricalPerformanceIID)).thenReturn(airHistoricalPerformanceData);
312
313         InstanceIdentifier<EthernetContainerHistoricalPerformances> ethContainerIID =
314                 InstanceIdentifier.builder(MwEthernetContainerPac.class, new MwEthernetContainerPacKey(uid))
315                         .child(EthernetContainerHistoricalPerformances.class).build();
316
317         org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.container.historical.performance.type.g.PerformanceData ethPerformanceData =
318                 new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.container.historical.performance.type.g.PerformanceDataBuilder()
319                         .build();
320         List<org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ethernet.container.historical.performances.g.HistoricalPerformanceDataList> ethHistPMList =
321                 Arrays.asList(
322                         new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.ethernet.container.historical.performances.g.HistoricalPerformanceDataListBuilder()
323                         .setHistoryDataId("123")
324                         .setGranularityPeriod(GranularityPeriodType.Period24Hours)
325                         .setSuspectIntervalFlag(true)
326                                 .setPerformanceData(ethPerformanceData).build());
327         EthernetContainerHistoricalPerformances ethContainerHistoricalPerformanceData =
328                 new EthernetContainerHistoricalPerformancesBuilder().setHistoricalPerformanceDataList(YangToolsMapperHelper.toMap(ethHistPMList))
329                         .build();
330         when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
331                 ethContainerIID)).thenReturn(ethContainerHistoricalPerformanceData);
332
333         Lp lp = new LpBuilder().setUuid(uid).build();;
334         WrapperMicrowaveModelRev180907 wrapperMicrowaveModelRev180907 =
335                 new WrapperMicrowaveModelRev180907(accessor, serviceProvider);
336
337         wrapperMicrowaveModelRev180907.getLtpHistoricalPerformanceData(ONFLayerProtocolName.MWAIRINTERFACE, lp);
338     }
339 }