diff options
Diffstat (limited to 'graph-inventory/aai-client')
6 files changed, 47 insertions, 22 deletions
diff --git a/graph-inventory/aai-client/pom.xml b/graph-inventory/aai-client/pom.xml index 39555f3f4a..8c7be3eb7e 100644 --- a/graph-inventory/aai-client/pom.xml +++ b/graph-inventory/aai-client/pom.xml @@ -72,7 +72,6 @@ <artifactItem> <groupId>org.onap.aai.schema-service</groupId> <artifactId>aai-schema</artifactId> - <version>1.6.5</version> <outputDirectory>${project.build.directory}/swagger</outputDirectory> <includes>**/*.yaml</includes> </artifactItem> @@ -276,7 +275,6 @@ <dependency> <groupId>org.onap.aai.schema-service</groupId> <artifactId>aai-schema</artifactId> - <version>1.6.5</version> </dependency> <dependency> <groupId>com.jayway.jsonpath</groupId> diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIObjectName.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIObjectName.java index 180a99e88b..d2b2300ee9 100644 --- a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIObjectName.java +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIObjectName.java @@ -1,23 +1,7 @@ package org.onap.aaiclient.client.aai; import org.onap.aaiclient.client.graphinventory.GraphInventoryObjectName; -import com.google.common.base.CaseFormat; -public class AAIObjectName implements GraphInventoryObjectName { +public interface AAIObjectName extends GraphInventoryObjectName { - private final String name; - - public AAIObjectName(String name) { - this.name = name; - } - - @Override - public String typeName() { - return name; - } - - @Override - public String typeName(CaseFormat format) { - return CaseFormat.LOWER_HYPHEN.to(format, this.name); - } } diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIVersion.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIVersion.java index 0ddbb8fae5..ef43717b4f 100644 --- a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIVersion.java +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIVersion.java @@ -32,7 +32,8 @@ public enum AAIVersion implements GraphInventoryVersion { V16("v16"), V17("v17"), V18("v18"), - V19("v19"); + V19("v19"), + V20("v20"); public static final AAIVersion LATEST = AAIVersion.values()[AAIVersion.values().length - 1]; private final String value; diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/uri/AAIFluentSingleType.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/uri/AAIFluentSingleType.java index 9310933499..519e49335d 100644 --- a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/uri/AAIFluentSingleType.java +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/uri/AAIFluentSingleType.java @@ -1,12 +1,25 @@ package org.onap.aaiclient.client.aai.entities.uri; +import org.onap.aaiclient.client.aai.AAIObjectName; import org.onap.aaiclient.client.aai.AAIObjectType; import org.onap.aaiclient.client.graphinventory.GraphInventoryFluentType; +import com.google.common.base.CaseFormat; public interface AAIFluentSingleType extends GraphInventoryFluentType<AAIObjectType> { - public interface Info extends GraphInventoryFluentType.Info { + public interface Info extends GraphInventoryFluentType.Info, AAIObjectName { + public default String typeName() { + return this.getName(); + } + + public default String typeName(CaseFormat format) { + return CaseFormat.LOWER_HYPHEN.to(format, this.getName()); + } + + public interface UriParams extends GraphInventoryFluentType.Info.UriParams { + + } } } diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/GraphInventoryFluentType.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/GraphInventoryFluentType.java index 94fa240244..5741bf36eb 100644 --- a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/GraphInventoryFluentType.java +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/GraphInventoryFluentType.java @@ -4,6 +4,12 @@ public interface GraphInventoryFluentType<T> extends GraphInventoryFluentTypeBas public interface Info extends GraphInventoryFluentTypeBase.Info { String getName(); + + UriParams getUriParams(); + + public interface UriParams { + + } } T build(); diff --git a/graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/AAIObjectTypeTest.java b/graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/AAIObjectTypeTest.java index 829ef1d646..000521bdf6 100644 --- a/graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/AAIObjectTypeTest.java +++ b/graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/AAIObjectTypeTest.java @@ -24,10 +24,10 @@ import static org.junit.Assert.assertEquals; import org.junit.Test; import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; public class AAIObjectTypeTest { - @Test public void fromTypeNameTest() throws IllegalArgumentException, IllegalAccessException, InstantiationException { AAIObjectType type = AAIObjectType.fromTypeName("allotted-resource"); @@ -88,4 +88,27 @@ public class AAIObjectTypeTest { AAIResourceUri aaiUri = AAIUriFactory.createResourceUri(AAIObjectType.NETWORK_POLICY, id); assertEquals("/network/network-policies/network-policy/test1", aaiUri.build().toString()); } + + @Test + public void equalityTest() { + + AAIObjectType genericVnf = AAIFluentTypeBuilder.network().genericVnf("test").build(); + + assertEquals(AAIObjectType.GENERIC_VNF, genericVnf); + + } + + @Test + public void uriParamTest() { + + assertEquals("vnf-id", AAIFluentTypeBuilder.Types.GENERIC_VNF.getUriParams().vnfId); + + assertEquals("l-interface.interface-name", AAIFluentTypeBuilder.Types.L_INTERFACE.getUriParams().interfaceName); + + assertEquals("cloud-owner", AAIFluentTypeBuilder.Types.CLOUD_REGION.getUriParams().cloudOwner); + + assertEquals("cloud-region-id", AAIFluentTypeBuilder.Types.CLOUD_REGION.getUriParams().cloudRegionId); + + + } } |