diff options
Diffstat (limited to 'common/src/test')
3 files changed, 38 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); + } + +} diff --git a/common/src/test/resources/logback-test.xml b/common/src/test/resources/logback-test.xml index 772eeabeb6..b52e6be022 100644 --- a/common/src/test/resources/logback-test.xml +++ b/common/src/test/resources/logback-test.xml @@ -65,6 +65,10 @@ <appender-ref ref="STDOUT" /> </logger> + <logger name="org.reflections" level="ERROR" additivity="false"> + <appender-ref ref="STDOUT" /> + </logger> + <root level="WARN"> <appender-ref ref="STDOUT" /> |