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 java.util.ArrayList;
34 import java.util.List;
36 import static org.junit.jupiter.api.Assertions.assertEquals;
37 import static org.junit.jupiter.api.Assertions.assertTrue;
39 @RunWith(PowerMockRunner.class)
40 @PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*"})
41 @PowerMockRunnerDelegate(SpringRunner.class)
42 @SpringBootTest(classes = SliceConfigRequestTest.class)
43 public class SliceConfigRequestTest {
46 public void SliceConfigRequestTest() {
48 List<String> sliceIdentifiers = new ArrayList<>();
49 List<String> configParams = new ArrayList<>();
51 SliceConfigRequest sliceConfigRequest = new SliceConfigRequest();
52 sliceConfigRequest.setConfigParams(configParams);
53 sliceConfigRequest.setSliceIdentifiers(sliceIdentifiers);
56 assertEquals(sliceIdentifiers, sliceConfigRequest.getSliceIdentifiers());
57 assertEquals(configParams, sliceConfigRequest.getConfigParams());
61 public void SliceConfigRequestEqualsTest() {
63 List<String> sliceIdentifiers = new ArrayList<>();
64 List<String> configParams = new ArrayList<>();
66 SliceConfigRequest sliceConfigRequest = new SliceConfigRequest();
67 sliceConfigRequest.setConfigParams(configParams);
68 sliceConfigRequest.setSliceIdentifiers(sliceIdentifiers);
70 SliceConfigRequest sliceConfigRequest1 = new SliceConfigRequest();
71 sliceConfigRequest1.setConfigParams(configParams);
72 sliceConfigRequest1.setSliceIdentifiers(sliceIdentifiers);
75 assertTrue(sliceConfigRequest1.equals(sliceConfigRequest));
76 assertTrue(StringUtils.isNotBlank(sliceConfigRequest.toString()));
77 assertTrue(sliceConfigRequest.hashCode() != 0);