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