summaryrefslogtreecommitdiffstats
path: root/framework/src
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-10-11 11:14:58 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-10-11 11:14:58 +0530
commitbed220d657959425cd358108e5c1a410a3cbbb89 (patch)
tree180c8c93e0f434307341b148eefd10bff5de3e81 /framework/src
parent9c5cdc09cb164e9fa12b174f590053fe90e1535b (diff)
Verfiy Invalid samples
CLI-2 Change-Id: I7388da38841d07bacf64d10a2c11620dfb781c12 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src')
-rw-r--r--framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java4
-rw-r--r--framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java11
2 files changed, 11 insertions, 4 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java
index 8d2d7c7a..32e5cf65 100644
--- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java
+++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java
@@ -28,10 +28,6 @@ public class OnapCommandInvalidSample extends OnapCommandException {
private static final String ERROR_MSG = "Invalid command sample ";
- public OnapCommandInvalidSample(String error) {
- this(ERROR_CODE, error);
- }
-
public OnapCommandInvalidSample(String schema, String error) {
super(ERROR_CODE, ERROR_MSG + schema + ", " + error);
}
diff --git a/framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java b/framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java
index e56eac03..cc12cfc0 100644
--- a/framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/error/OnapCommandErrorTest.java
@@ -256,6 +256,17 @@ public class OnapCommandErrorTest {
}
@Test
+ public void onapCommandSampleInvalidTest() {
+ OnapCommandInvalidSample failed = new OnapCommandInvalidSample("Test", "error");
+
+ assertEquals("0xf001::Invalid command sample Test, error", failed.getMessage());
+
+ failed = new OnapCommandInvalidSample("Test", new Exception("error"));
+
+ assertEquals("0xf001::Invalid command sample Test, error", failed.getMessage());
+ }
+
+ @Test
public void onapCommandServiceNotFoundTest() {
OnapCommandServiceNotFound failed = new OnapCommandServiceNotFound("Service");