summaryrefslogtreecommitdiffstats
path: root/auth/auth-cass/src/test
diff options
context:
space:
mode:
authorSean Hassan <sean.hassan@att.com>2020-05-21 16:22:11 -0500
committerHassan, Sean (sh265m) <sean.hassan@att.com>2020-05-22 13:59:04 -0500
commitb6106cffafc89a9c3051c3196f54df643197e4ad (patch)
treecff90ac9839a734428a564a63e98547efa87e626 /auth/auth-cass/src/test
parentf8e4fae3bb0e9a7d40a70a64971efd1813bee2d1 (diff)
Enable Organizations to have a subset of users the user roles of which do not expire
Issue-ID: AAF-1149 Signed-off-by: Sean Hassan <sean.hassan@att.com> Change-Id: Iaf04456abe78f2cb7972587b50f00bcaac3f83aa
Diffstat (limited to 'auth/auth-cass/src/test')
-rw-r--r--auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/hl/JU_PermLookup.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/hl/JU_PermLookup.java b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/hl/JU_PermLookup.java
index f5d22ba2..1d82505e 100644
--- a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/hl/JU_PermLookup.java
+++ b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/hl/JU_PermLookup.java
@@ -49,6 +49,7 @@ import org.onap.aaf.auth.layer.Result;
import org.onap.aaf.cadi.Access;
import org.onap.aaf.cadi.CadiException;
import org.onap.aaf.misc.env.LogTarget;
+import org.onap.aaf.org.DefaultOrg;
@RunWith(MockitoJUnitRunner.class)
@@ -130,13 +131,17 @@ public class JU_PermLookup {
Result<List<UserRoleDAO.Data>> retVal1 = Mockito.mock(Result.class);
retVal1.value = new ArrayList<UserRoleDAO.Data>();
UserRoleDAO.Data dataObj = Mockito.mock( UserRoleDAO.Data.class);
-
dataObj.expires = new Date();
retVal1.value.add(dataObj);
Mockito.doReturn(true).when(retVal1).isOKhasData();
+
Mockito.doReturn(retVal1).when(userRoleDAO).readByUser(trans,"");
- PermLookup cassExecutorObj =PermLookup.get(trans, q,"");
+
+ DefaultOrg org = Mockito.mock(DefaultOrg.class);
+ when(trans.org()).thenReturn(org);
+
+ PermLookup cassExecutorObj = PermLookup.get(trans, q,"");
Result<List<UserRoleDAO.Data>> userRoles = cassExecutorObj.getUserRoles();
//System.out.println(""+userRoles.status);
@@ -151,7 +156,11 @@ public class JU_PermLookup {
Mockito.doReturn(false).when(retVal1).isOKhasData();
Mockito.doReturn(retVal1).when(userRoleDAO).readByUser(trans,"");
- PermLookup cassExecutorObj =PermLookup.get(trans, q,"");
+
+ DefaultOrg org = Mockito.mock(DefaultOrg.class);
+ when(trans.org()).thenReturn(org);
+
+ PermLookup cassExecutorObj = PermLookup.get(trans, q,"");
Result<List<UserRoleDAO.Data>> userRoles = cassExecutorObj.getUserRoles();
// System.out.println("output is"+userRoles.status);
@@ -174,7 +183,11 @@ public class JU_PermLookup {
retVal1.value.add(dataObj);
Mockito.doReturn(true).when(retVal1).isOKhasData();
Mockito.doReturn(retVal1).when(userRoleDAO).readByUser(trans,"");
- PermLookup cassExecutorObj =PermLookup.get(trans, q,"");
+
+ DefaultOrg org = Mockito.mock(DefaultOrg.class);
+ when(trans.org()).thenReturn(org);
+
+ PermLookup cassExecutorObj = PermLookup.get(trans, q,"");
Result<List<UserRoleDAO.Data>> userRoles = cassExecutorObj.getUserRoles();
//System.out.println(userRoles.status);