diff options
author | Shubhada <SV00449682@techmahindra.com> | 2018-02-01 17:02:09 +0530 |
---|---|---|
committer | Patrick Brady <pb071s@att.com> | 2018-02-06 05:26:34 +0000 |
commit | fc325fc52719a5db0b0047e82355bcacb4f88d28 (patch) | |
tree | 168d63ee9f8fc1d22769f20c2291f7bcf4eea003 /appc-sdc-listener | |
parent | d8d05ed2691a24bd278736064c1cd695fe785808 (diff) |
Unit test for APPC yang generator
Provide unit coverage for
/org/onap/appc/yang/type bundle.
https://sonar.onap.org/drilldown/measures/114359?highlight=coverage&metric=uncovered_lines&rids%5B%5D=115255&rids%5B%5D=115275
Change-Id: I3cb77301b7d7369aa95dd5c493af690f6c5fcd59
Signed-off-by: Shubhada <SV00449682@techmahindra.com>
Issue-ID: APPC-534"
Diffstat (limited to 'appc-sdc-listener')
-rw-r--r-- | appc-sdc-listener/appc-yang-generator/src/test/java/org/onap/appc/yang/type/TestYangTypes.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/appc-sdc-listener/appc-yang-generator/src/test/java/org/onap/appc/yang/type/TestYangTypes.java b/appc-sdc-listener/appc-yang-generator/src/test/java/org/onap/appc/yang/type/TestYangTypes.java new file mode 100644 index 000000000..778574f1c --- /dev/null +++ b/appc-sdc-listener/appc-yang-generator/src/test/java/org/onap/appc/yang/type/TestYangTypes.java @@ -0,0 +1,28 @@ +package org.onap.appc.yang.type; + +import static org.junit.Assert.assertEquals; +import java.util.Map; +import org.junit.Test; + +public class TestYangTypes { + private Map<String, String> testTypeMap = YangTypes.getYangTypeMap(); + + @Test + public void testGetYangTypeMap_Size() { + assertEquals(48, testTypeMap.size()); + } + @Test(expected = java.lang.UnsupportedOperationException.class) + public void testGetYangTypeMap_UnModifiableMap() { + testTypeMap.remove("timeticks"); + assertEquals(47, testTypeMap.size()); + } + @Test + public void testGetYangTypeMap_ValidKey() { + assertEquals("uint64", testTypeMap.get("uint64")); + } + @Test + public void testGetYangTypeMap_In_ValidKey() { + assertEquals(null, testTypeMap.get("uint128")); + } + +} |