summaryrefslogtreecommitdiffstats
path: root/authz-cmd/src/test/java/org/onap/aaf/cmd/ns/JU_ListUsersInRole.java
diff options
context:
space:
mode:
Diffstat (limited to 'authz-cmd/src/test/java/org/onap/aaf/cmd/ns/JU_ListUsersInRole.java')
-rw-r--r--authz-cmd/src/test/java/org/onap/aaf/cmd/ns/JU_ListUsersInRole.java40
1 files changed, 18 insertions, 22 deletions
diff --git a/authz-cmd/src/test/java/org/onap/aaf/cmd/ns/JU_ListUsersInRole.java b/authz-cmd/src/test/java/org/onap/aaf/cmd/ns/JU_ListUsersInRole.java
index 7fc7af3c..786adb54 100644
--- a/authz-cmd/src/test/java/org/onap/aaf/cmd/ns/JU_ListUsersInRole.java
+++ b/authz-cmd/src/test/java/org/onap/aaf/cmd/ns/JU_ListUsersInRole.java
@@ -30,42 +30,38 @@ import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import org.onap.aaf.cmd.AAFcli;
import org.onap.aaf.cmd.JU_AAFCli;
-import org.onap.aaf.cmd.ns.List;
-import org.onap.aaf.cmd.ns.ListUsers;
-import org.onap.aaf.cmd.ns.ListUsersInRole;
-import org.onap.aaf.cmd.ns.NS;
-
-import org.onap.aaf.cadi.CadiException;
-import org.onap.aaf.cadi.LocatorException;
-import org.onap.aaf.inno.env.APIException;
@RunWith(MockitoJUnitRunner.class)
public class JU_ListUsersInRole {
-
+
private static ListUsersInRole lsUserinRole;
-
+
@BeforeClass
- public static void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
+ public static void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException {
AAFcli cli = JU_AAFCli.getAAfCli();
NS ns = new NS(cli);
List ls = new List(ns);
ListUsers lsU = new ListUsers(ls);
lsUserinRole = new ListUsersInRole(lsU);
}
-
+
@Test
public void exec() {
try {
- assertEquals(lsUserinRole._exec(0, "add","del","reset","extend"),500);
- } catch (CadiException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (APIException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (LocatorException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ assertEquals(lsUserinRole._exec(0, "add", "del", "reset", "extend"), 500);
+ } catch (Exception e) {
+ assertEquals(e.getMessage(), "java.net.UnknownHostException: DME2RESOLVE");
+ }
+ }
+
+ @Test
+ public void detailedHelp() {
+ boolean hasNoError = true;
+ try {
+ lsUserinRole.detailedHelp(1, new StringBuilder("test"));
+ } catch (Exception e) {
+ hasNoError = false;
}
+ assertEquals(hasNoError, true);
}
}