@Test
public void assignedFedoraRule() {
UserAccountService userAccountService =
seam.autowire(UserAccountServiceImpl.class);
// Non Fedora account
HAccount account = createFedoraAccount();
assertThat(new ArrayList<HAccountRole>(account.getRoles()),
not(Matchers.<HAccountRole> hasItem(hasProperty("name",
Matchers.is("Fedora")))));
account =
userAccountService.runRoleAssignmentRules(account, account
.getCredentials().iterator().next(), "fedora");
// Now it's fedora
assertThat(
new ArrayList<HAccountRole>(account.getRoles()),
Matchers.<HAccountRole> hasItem(hasProperty("name",
Matchers.is("Fedora"))));
}