c8d999ea506bf1268fe04eda250cace084c2f3a8
[dcaegen2/services.git] / components / slice-analysis-ms / src / test / java / org / onap / slice / analysis / ms / models / AggregatedConfigTest.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  slice-analysis-ms
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
10  *
11  *          http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  *
20  *******************************************************************************/
21
22 package org.onap.slice.analysis.ms.models;
23
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;
32
33 import static org.junit.jupiter.api.Assertions.assertEquals;
34 import static org.junit.jupiter.api.Assertions.assertTrue;
35
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 {
41
42     @Test
43     public void AggregatedConfigTest() {
44
45         AggregatedConfig aggregatedConfig = new AggregatedConfig();
46         aggregatedConfig.setDLThptPerSlice(1);
47         aggregatedConfig.setULThptPerSlice(2);
48         aggregatedConfig.setMaxNumberOfConns(3);
49
50         assertEquals(1, aggregatedConfig.getDLThptPerSlice());
51         assertEquals(2, aggregatedConfig.getULThptPerSlice());
52         assertEquals(3, aggregatedConfig.getMaxNumberOfConns());
53     }
54
55     @Test
56     public void RelationshipListEqualsTest() {
57
58
59         AggregatedConfig aggregatedConfig = new AggregatedConfig();
60         aggregatedConfig.setDLThptPerSlice(1);
61         aggregatedConfig.setULThptPerSlice(2);
62         aggregatedConfig.setMaxNumberOfConns(3);
63
64
65         AggregatedConfig aggregatedConfig2 = new AggregatedConfig();
66         aggregatedConfig2.setDLThptPerSlice(1);
67         aggregatedConfig2.setULThptPerSlice(2);
68         aggregatedConfig2.setMaxNumberOfConns(3);
69
70
71         assertTrue(aggregatedConfig2.equals(aggregatedConfig));
72         assertTrue(StringUtils.isNotBlank(aggregatedConfig.toString()));
73         assertTrue(aggregatedConfig.hashCode() != 0);
74     }
75 }