1 /*******************************************************************************
2 * ============LICENSE_START=======================================================
3 * ONAP : ccsdk feature sdnr wt
4 * ================================================================================
5 * Copyright (C) 2019 Nokia 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=========================================================
20 ******************************************************************************/
21 package org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.container;
23 import org.junit.Before;
24 import org.junit.Test;
25 import org.onap.ccsdk.features.sdnr.wt.devicemanager.performancemanager.impl.database.types.EsHistoricalPerformance15Minutes;
26 import org.onap.ccsdk.features.sdnr.wt.devicemanager.performancemanager.impl.database.types.EsHistoricalPerformance24Hours;
28 import java.util.List;
30 import static org.junit.Assert.assertEquals;
31 import static org.mockito.Mockito.mock;
34 public class AllPmTest {
40 allPm = AllPm.getEmpty();
44 public void shouldCreateEmptyInstance() {
45 assertEquals(0, allPm.size());
50 public void shouldBePossibleToAdd15MinutesPerformanceMeasurements() {
52 final EsHistoricalPerformance15Minutes esHistoricalPerformance15Minutes_1 = mock(EsHistoricalPerformance15Minutes.class);
53 final EsHistoricalPerformance15Minutes esHistoricalPerformance15Minutes_2 = mock(EsHistoricalPerformance15Minutes.class);
55 allPm.add(esHistoricalPerformance15Minutes_1);
56 allPm.add(esHistoricalPerformance15Minutes_2);
60 final List<EsHistoricalPerformance15Minutes> pm15size = allPm.getPm15();
61 final List<EsHistoricalPerformance24Hours> pm24size = allPm.getPm24();
64 assertEquals(2, pm15size.size());
65 assertEquals(0, pm24size.size());
69 public void shouldBePossibleToAdd24HoursPerformanceMeasurements() {
71 final EsHistoricalPerformance24Hours esHistoricalPerformance24Hours_1 = mock(EsHistoricalPerformance24Hours.class);
72 final EsHistoricalPerformance24Hours esHistoricalPerformance24Hours_2 = mock(EsHistoricalPerformance24Hours.class);
74 allPm.add(esHistoricalPerformance24Hours_1);
75 allPm.add(esHistoricalPerformance24Hours_2);
79 final List<EsHistoricalPerformance15Minutes> pm15size = allPm.getPm15();
80 final List<EsHistoricalPerformance24Hours> pm24size = allPm.getPm24();
83 assertEquals(0, pm15size.size());
84 assertEquals(2, pm24size.size());
88 public void shouldBePossibleToAddPerformanceMeasurements() {
90 final EsHistoricalPerformance15Minutes esHistoricalPerformance15Minutes = mock(EsHistoricalPerformance15Minutes.class);
91 final EsHistoricalPerformance24Hours esHistoricalPerformance24Hours = mock(EsHistoricalPerformance24Hours.class);
93 allPm.add(esHistoricalPerformance15Minutes);
94 allPm.add(esHistoricalPerformance24Hours);
97 final int size = allPm.size();
100 assertEquals(2, size);