From 78af232946c8534fa154bd0b425daf2bcac73e00 Mon Sep 17 00:00:00 2001 From: surya-huawei Date: Tue, 3 Oct 2017 16:09:04 +0530 Subject: Add unit test for ccsdk/core *Add a unit test for SliStringUtils This is to test substring method of SliStringUtils and improve code coverage Issue-Id: CCSDK-106 Change-Id: I73c5af3b036a92fdcb1d3d1be7eb0b3abc44fd5a Signed-off-by: surya-huawei --- .../ccsdk/sli/core/slipluginutils/SliStringUtilsTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sliPluginUtils/provider/src/test/java/org') 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 96c6ae4ac..4fc8d1866 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 @@ -90,6 +90,18 @@ public class SliStringUtilsTest { assertThat(ctx.getAttribute("result_length"), equalTo("2")); } + @Test + public final void testSubString() throws SvcLogicException { + param.put("string","splitatgivenindex"); + param.put("begin-index","0"); + param.put("end-index","5"); + param.put("result","result"); + + stringUtils.substring(param, ctx); + + assertEquals("split", ctx.getAttribute("result")); + } + @Test public final void testQuotedOrNull() throws SvcLogicException { //param.put("nullString",null); -- cgit 1.2.3-korg