+ /**
+ * Setup Role Data for Mock Usages
+ * @param trans
+ * @param user
+ * @param ns
+ * @param role
+ * @param exists
+ * @param days
+ */
+ protected void whenRole(AuthzTrans trans, String user, String ns, String role, boolean exists, int days) {
+ Result<List<UserRoleDAO.Data>> result;
+ if(exists) {
+ result = Result.ok(listOf(urData(user,ns,role,days)));
+ } else {
+ result = Result.ok(emptyList(UserRoleDAO.Data.class));
+ }
+ when(question.userRoleDAO().read(trans, user, ns+'.'+role)).thenReturn(result);
+ }
+