diff options
-rwxr-xr-x | sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java | 3 | ||||
-rwxr-xr-x | sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java index 0300236f7..730f272ba 100755 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java @@ -1255,6 +1255,9 @@ public class MdsalHelper { return (inStr); } + // This is needed for enums containing under scores + inStr = inStr.replaceAll("_", ""); + // This will strip out all periods, which cannot be in a java enum inStr = inStr.replaceAll("\\.", ""); diff --git a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java index 744d48d70..cebb99663 100755 --- a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java +++ b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java @@ -151,6 +151,7 @@ public class MdsalHelperTest extends TestCase { } public void testToJavaEnum() throws Exception { + assertEquals("VENDOR6500MODEL", MdsalHelper.toJavaEnum("VENDOR_6500_MODEL")); assertEquals("_2018HelloWorld", MdsalHelper.toJavaEnum("2018Hello World")); assertEquals("SomethingElse", MdsalHelper.toJavaEnum("Something.Else")); assertEquals("MyTestString", MdsalHelper.toJavaEnum("my-test-string")); |