aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java3
-rwxr-xr-xsli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java1
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 0300236f..730f272b 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 744d48d7..cebb9966 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"));