2 * ============LICENSE_START=======================================================
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
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=========================================================
22 package org.onap.aaiclient.client.aai;
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;
29 public class AAIObjectTypeTest {
32 public void fromTypeNameTest() throws IllegalArgumentException, IllegalAccessException, InstantiationException {
33 AAIObjectType type = AAIObjectType.fromTypeName("generic-query");
34 assertEquals("generic-query", type.typeName());
39 public void customTypeTest() throws IllegalArgumentException, IllegalAccessException, InstantiationException {
40 AAIObjectType type = AAIObjectType.fromTypeName("my-custom-name");
41 assertEquals("my-custom-name", type.typeName());
46 public void equalityTest() {
48 AAIObjectType genericVnf = AAIFluentTypeBuilder.network().genericVnf("test").build();
49 AAIObjectType genericVnf2 = AAIFluentTypeBuilder.network().genericVnf("test2").build();
51 assertEquals(genericVnf2, genericVnf);
55 public void uriParamTest() {
57 assertEquals("vnf-id", AAIFluentTypeBuilder.Types.GENERIC_VNF.getUriParams().vnfId);
59 assertEquals("l-interface.interface-name", AAIFluentTypeBuilder.Types.L_INTERFACE.getUriParams().interfaceName);
61 assertEquals("cloud-owner", AAIFluentTypeBuilder.Types.CLOUD_REGION.getUriParams().cloudOwner);
63 assertEquals("cloud-region-id", AAIFluentTypeBuilder.Types.CLOUD_REGION.getUriParams().cloudRegionId);