diff options
author | 2018-04-25 21:13:56 +0000 | |
---|---|---|
committer | 2018-04-25 21:13:56 +0000 | |
commit | 898ccabd60d1eea9c638386793b2a40215418b5f (patch) | |
tree | 37988c4904491e9542fbfd9e4b1d0a9f7d40090c /sliPluginUtils/provider/src/test/java/org/onap | |
parent | 800db9725a780afcbf41b29affecdcca8c6851e9 (diff) |
add replaceAll to slistringutils
add replaceAll to slistringutils because it supports regular expressions and replace does not
Change-Id: Ibff7acd339103a6bb897d14ca3d31736a5b568ef
Issue-ID: CCSDK-253
Signed-off-by: Smokowski, Kevin (ks6305) <ks6305@att.com>
Diffstat (limited to 'sliPluginUtils/provider/src/test/java/org/onap')
-rw-r--r-- | sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliStringUtilsTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliStringUtilsTest.java b/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliStringUtilsTest.java index 4fc8d1866..4c665121c 100644 --- a/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliStringUtilsTest.java +++ b/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliStringUtilsTest.java @@ -234,6 +234,21 @@ public class SliStringUtilsTest { SliStringUtils.replace(param, ctx); assertEquals(sourceString.replace(old, neww), ctx.getAttribute(outputPath)); } + + @Test + public void replaceAll() throws SvcLogicException { + String source = "cat Hello World cat"; + String target = "\\s"; + String replacement = ""; + String outputPath = "out"; + + param.put("source", source); + param.put("target", target); + param.put("replacement", replacement); + param.put("outputPath", outputPath); + SliStringUtils.replaceAll(param, ctx); + assertEquals(source.replaceAll(target, replacement), ctx.getAttribute(outputPath)); + } @Test public void concat() throws SvcLogicException { |