NIHVIVO-3523 Implement more functionality for unit tests.
This commit is contained in:
parent
20b7f694d1
commit
e72cd6a78b
1 changed files with 10 additions and 6 deletions
|
@ -20,6 +20,7 @@ public class UserAccountsDaoStub implements UserAccountsDao {
|
||||||
private static final Log log = LogFactory.getLog(UserAccountsDaoStub.class);
|
private static final Log log = LogFactory.getLog(UserAccountsDaoStub.class);
|
||||||
|
|
||||||
private final Map<String, UserAccount> userAccountsByUri = new HashMap<String, UserAccount>();
|
private final Map<String, UserAccount> userAccountsByUri = new HashMap<String, UserAccount>();
|
||||||
|
private final Map<String, PermissionSet> permissionSetsByUri = new HashMap<String, PermissionSet>();
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Stub infrastructure
|
// Stub infrastructure
|
||||||
|
@ -29,6 +30,10 @@ public class UserAccountsDaoStub implements UserAccountsDao {
|
||||||
userAccountsByUri.put(user.getUri(), user);
|
userAccountsByUri.put(user.getUri(), user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addPermissionSet(PermissionSet ps) {
|
||||||
|
permissionSetsByUri.put(ps.getUri(), ps);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Stub methods
|
// Stub methods
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
@ -38,6 +43,11 @@ public class UserAccountsDaoStub implements UserAccountsDao {
|
||||||
return userAccountsByUri.get(uri);
|
return userAccountsByUri.get(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PermissionSet getPermissionSetByUri(String uri) {
|
||||||
|
return permissionSetsByUri.get(uri);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Un-implemented methods
|
// Un-implemented methods
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
@ -66,12 +76,6 @@ public class UserAccountsDaoStub implements UserAccountsDao {
|
||||||
"UserAccountsDaoStub.deleteUserAccount() not implemented.");
|
"UserAccountsDaoStub.deleteUserAccount() not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public PermissionSet getPermissionSetByUri(String uri) {
|
|
||||||
throw new RuntimeException(
|
|
||||||
"UserAccountsDaoStub.getPermissionSetByUri() not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<PermissionSet> getAllPermissionSets() {
|
public Collection<PermissionSet> getAllPermissionSets() {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue