diff options
author | Steve Smokowski <ss835w@att.com> | 2019-01-28 13:53:02 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-01-28 13:53:02 +0000 |
commit | 1f57cd06a3bf1deeb277430dba310088368c82fa (patch) | |
tree | 63015921567bdea04574c4b528227020bf600bce /common/src/test/java/org/onap | |
parent | cfd23fabab7a07981a0f0d23797b922cdaf6e2cb (diff) | |
parent | 1e05b82f5633a6430761e053701264dd4ec4468b (diff) |
Merge "add custom object support to a ai client"
Diffstat (limited to 'common/src/test/java/org/onap')
-rw-r--r-- | common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java | 14 | ||||
-rw-r--r-- | common/src/test/java/org/onap/so/client/aai/objects/CustomAAIObjectType.java | 20 |
2 files changed, 34 insertions, 0 deletions
diff --git a/common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java b/common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java index ea842719e8..d4eaf0873b 100644 --- a/common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java +++ b/common/src/test/java/org/onap/so/client/aai/AAIObjectTypeTest.java @@ -28,6 +28,20 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory; public class AAIObjectTypeTest { + + @Test + public void fromTypeNameTest() throws IllegalArgumentException, IllegalAccessException, InstantiationException { + AAIObjectType type = AAIObjectType.fromTypeName("allotted-resource"); + assertEquals("allotted-resource", type.typeName()); + + } + + @Test + public void customTypeTest() throws IllegalArgumentException, IllegalAccessException, InstantiationException { + AAIObjectType type = AAIObjectType.fromTypeName("my-custom-name"); + assertEquals("my-custom-name", type.typeName()); + + } @Test public void verifyDefaultCase() { assertEquals("default removed for tenant", "tenant", AAIObjectType.DEFAULT_TENANT.typeName()); diff --git a/common/src/test/java/org/onap/so/client/aai/objects/CustomAAIObjectType.java b/common/src/test/java/org/onap/so/client/aai/objects/CustomAAIObjectType.java new file mode 100644 index 0000000000..b964e905de --- /dev/null +++ b/common/src/test/java/org/onap/so/client/aai/objects/CustomAAIObjectType.java @@ -0,0 +1,20 @@ +package org.onap.so.client.aai.objects; + +import org.onap.so.client.aai.AAINamespaceConstants; +import org.onap.so.client.aai.AAIObjectType; + +public class CustomAAIObjectType extends AAIObjectType { + + private static final long serialVersionUID = 1919729212831978098L; + + public static final AAIObjectType CUSTOM = new CustomAAIObjectType(AAINamespaceConstants.NETWORK, "my-url", "my-custom-name"); + + /* Default constructor automatically called by AAIObjectType */ + public CustomAAIObjectType() { + super(); + } + protected CustomAAIObjectType(String parent, String uri, String name) { + super(parent, uri, name); + } + +} |