diff options
author | Timoney, Dan (dt5972) <dtimoney@att.com> | 2019-03-05 12:06:50 -0500 |
---|---|---|
committer | Timoney, Dan (dt5972) <dtimoney@att.com> | 2019-03-05 12:06:50 -0500 |
commit | 76cd2593032c578b0af9fe089cf6431c7a2060d4 (patch) | |
tree | 8a21a6f8372ba4e0c81a5eebaba508dad66a874f /sliapi/provider/src/test/java/org | |
parent | 23ff887d1e61e490b48f735a49c434d50efa1639 (diff) |
Add junit test cases
Add junit test cases for sli/core repository.
Change-Id: Ifcec596cf9f835249a7967c9c7830253b53d2ef6
Issue-ID: CCSDK-1128
Signed-off-by: Timoney, Dan (dt5972) <dtimoney@att.com>
Diffstat (limited to 'sliapi/provider/src/test/java/org')
-rw-r--r-- | sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java b/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java index 5106d6fc2..0326429c9 100644 --- a/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java +++ b/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java @@ -152,6 +152,7 @@ public class TestSliapiProvider { public void testExecuteGraph() { ExecuteGraphInputBuilder inputBuilder = new ExecuteGraphInputBuilder(); + // Valid test - graph exists inputBuilder.setMode(ExecuteGraphInput.Mode.Sync); inputBuilder.setModuleName("sli"); inputBuilder.setRpcName("healthcheck"); @@ -160,9 +161,38 @@ public class TestSliapiProvider { pBuilder.setParameterName("int-parameter"); pBuilder.setIntValue(1); pList.add(pBuilder.build()); + pBuilder.setParameterName("bool-parameter"); + pBuilder.setIntValue(null); + pBuilder.setBooleanValue(true); + pList.add(pBuilder.build()); + pBuilder.setParameterName("str-parameter"); + pBuilder.setBooleanValue(null); + pBuilder.setStringValue("value"); + pList.add(pBuilder.build()); + inputBuilder.setSliParameter(pList); + provider.executeGraph(inputBuilder.build()); + + + // Invalid test - graph does not exist + inputBuilder.setMode(ExecuteGraphInput.Mode.Sync); + inputBuilder.setModuleName("sli"); + inputBuilder.setRpcName("no-such-graph"); + pList = new LinkedList<>(); + pBuilder = new SliParameterBuilder(); + pBuilder.setParameterName("int-parameter"); + pBuilder.setIntValue(1); + pList.add(pBuilder.build()); + pBuilder.setParameterName("bool-parameter"); + pBuilder.setIntValue(null); + pBuilder.setBooleanValue(true); + pList.add(pBuilder.build()); + pBuilder.setParameterName("str-parameter"); + pBuilder.setBooleanValue(null); + pBuilder.setStringValue("value"); + pList.add(pBuilder.build()); inputBuilder.setSliParameter(pList); - provider.executeGraph(inputBuilder.build()); + assertTrue(provider.vlbcheck(mock(VlbcheckInput.class)) instanceof Future<?>); } |