summaryrefslogtreecommitdiffstats
path: root/mdsal-resource/provider/src/test
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2017-10-03 13:36:21 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-03 13:36:21 +0000
commit1c8fff51420e5dc3ea45bd5089d8649a7178015f (patch)
tree945b3e9b0d05d1f90ddb890fc15a6f551c26ad2f /mdsal-resource/provider/src/test
parenta9b5088b8333f994fe8ab5507b82de3eadbb2226 (diff)
parentd0c9e06005c819b53970b72cf73ab814a3719109 (diff)
Merge "Add unit tests for mdsal-resource"
Diffstat (limited to 'mdsal-resource/provider/src/test')
-rw-r--r--mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestConfigResource.java29
-rw-r--r--mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestOperationalResource.java29
2 files changed, 58 insertions, 0 deletions
diff --git a/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestConfigResource.java b/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestConfigResource.java
new file mode 100644
index 000000000..a8f4d9483
--- /dev/null
+++ b/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestConfigResource.java
@@ -0,0 +1,29 @@
+package org.onap.ccsdk.sli.adaptors.resource.mdsal;
+
+import junit.framework.TestCase;
+
+import static org.mockito.Mockito.mock;
+
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+
+public class TestConfigResource extends TestCase {
+
+ public void test() throws Exception {
+
+ RestService restService = mock(RestService.class);
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ ConfigResource res = new ConfigResource(restService);
+
+ res.delete("my-resource", null, ctx);
+ res.notify("my-resource", "action", "key", ctx);
+ res.query("my-resource", false, "my-select", "mykey", "pfx", null, ctx);
+ res.release("my-resource", "mykey", ctx);
+ res.reserve("my-resource", "my-select", "mykey", "pfx", ctx);
+ res.exists("my-resource", "mykey", "pfx", ctx);
+ res.isAvailable("my-resource", "mykey", "pfx", ctx);
+ res.save("resource", false, false, null, null, null, ctx);
+ res.update("my-resource", "mykey", null, "pfx", ctx);
+ }
+
+}
diff --git a/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestOperationalResource.java b/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestOperationalResource.java
new file mode 100644
index 000000000..f5725e971
--- /dev/null
+++ b/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestOperationalResource.java
@@ -0,0 +1,29 @@
+package org.onap.ccsdk.sli.adaptors.resource.mdsal;
+
+import static org.mockito.Mockito.mock;
+
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+
+import junit.framework.TestCase;
+
+public class TestOperationalResource extends TestCase {
+
+
+ public void test() throws Exception {
+
+ RestService restService = mock(RestService.class);
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ OperationalResource res = new OperationalResource(restService);
+
+ res.delete("my-resource", null, ctx);
+ res.notify("my-resource", "action", "key", ctx);
+ res.query("my-resource", false, "my-select", "mykey", "pfx", null, ctx);
+ res.release("my-resource", "mykey", ctx);
+ res.reserve("my-resource", "my-select", "mykey", "pfx", ctx);
+ res.exists("my-resource", "mykey", "pfx", ctx);
+ res.isAvailable("my-resource", "mykey", "pfx", ctx);
+ res.save("resource", false, false, null, null, null, ctx);
+ res.update("my-resource", "mykey", null, "pfx", ctx);
+ }
+}