1 /*******************************************************************************
2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2022 CTC, Inc.
6 * ==============================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 *******************************************************************************/
22 package org.onap.slice.analysis.ms.models;
24 import org.apache.commons.lang3.StringUtils;
25 import org.junit.Test;
26 import org.junit.runner.RunWith;
27 import org.powermock.core.classloader.annotations.PowerMockIgnore;
28 import org.powermock.modules.junit4.PowerMockRunner;
29 import org.powermock.modules.junit4.PowerMockRunnerDelegate;
30 import org.springframework.boot.test.context.SpringBootTest;
31 import org.springframework.test.context.junit4.SpringRunner;
33 import static org.junit.jupiter.api.Assertions.assertEquals;
34 import static org.junit.jupiter.api.Assertions.assertTrue;
36 @RunWith(PowerMockRunner.class)
37 @PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*"})
38 @PowerMockRunnerDelegate(SpringRunner.class)
39 @SpringBootTest(classes = AggregatedConfigTest.class)
40 public class AggregatedConfigTest {
43 public void AggregatedConfigTest() {
45 AggregatedConfig aggregatedConfig = new AggregatedConfig();
46 aggregatedConfig.setDLThptPerSlice(1);
47 aggregatedConfig.setULThptPerSlice(2);
48 aggregatedConfig.setMaxNumberOfConns(3);
50 assertEquals(1, aggregatedConfig.getDLThptPerSlice());
51 assertEquals(2, aggregatedConfig.getULThptPerSlice());
52 assertEquals(3, aggregatedConfig.getMaxNumberOfConns());
56 public void RelationshipListEqualsTest() {
59 AggregatedConfig aggregatedConfig = new AggregatedConfig();
60 aggregatedConfig.setDLThptPerSlice(1);
61 aggregatedConfig.setULThptPerSlice(2);
62 aggregatedConfig.setMaxNumberOfConns(3);
65 AggregatedConfig aggregatedConfig2 = new AggregatedConfig();
66 aggregatedConfig2.setDLThptPerSlice(1);
67 aggregatedConfig2.setULThptPerSlice(2);
68 aggregatedConfig2.setMaxNumberOfConns(3);
71 assertTrue(aggregatedConfig2.equals(aggregatedConfig));
72 assertTrue(StringUtils.isNotBlank(aggregatedConfig.toString()));
73 assertTrue(aggregatedConfig.hashCode() != 0);