sonar issue, Change the assertion arguments to not compare dissimilar types
[so.git] / graph-inventory / aai-client / src / test / java / org / onap / aaiclient / client / aai / AAIObjectTypeTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright (C) 2022 Samsung Electronics
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
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
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
22 package org.onap.aaiclient.client.aai;
23
24 import static org.junit.Assert.assertEquals;
25 import org.junit.Test;
26 import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder;
27 import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
28
29 public class AAIObjectTypeTest {
30
31     @Test
32     public void fromTypeNameTest() throws IllegalArgumentException, IllegalAccessException, InstantiationException {
33         AAIObjectType type = AAIObjectType.fromTypeName("generic-query");
34         assertEquals("generic-query", type.typeName());
35
36     }
37
38     @Test
39     public void customTypeTest() throws IllegalArgumentException, IllegalAccessException, InstantiationException {
40         AAIObjectType type = AAIObjectType.fromTypeName("my-custom-name");
41         assertEquals("my-custom-name", type.typeName());
42
43     }
44
45     @Test
46     public void equalityTest() {
47
48         AAIObjectType genericVnf = AAIFluentTypeBuilder.network().genericVnf("test").build();
49         AAIObjectType genericVnf2 = AAIFluentTypeBuilder.network().genericVnf("test2").build();
50
51         assertEquals(genericVnf2, genericVnf);
52     }
53
54     @Test
55     public void uriParamTest() {
56
57         assertEquals("vnf-id", AAIFluentTypeBuilder.Types.GENERIC_VNF.getUriParams().vnfId);
58
59         assertEquals("l-interface.interface-name", AAIFluentTypeBuilder.Types.L_INTERFACE.getUriParams().interfaceName);
60
61         assertEquals("cloud-owner", AAIFluentTypeBuilder.Types.CLOUD_REGION.getUriParams().cloudOwner);
62
63         assertEquals("cloud-region-id", AAIFluentTypeBuilder.Types.CLOUD_REGION.getUriParams().cloudRegionId);
64
65
66     }
67 }