final Iterable<ProjectRole> projectRolesWithoutSelf = Iterables.transform(
projectRoles,
new Function<ProjectRole, ProjectRole>() {
@Override
public ProjectRole apply(final ProjectRole role) {
return new ProjectRole(role.getId(), null, role.getName(), role.getDescription(), Lists.newArrayList(role.getActors()));
}
}
);
assertThat(projectRolesWithoutSelf, containsInAnyOrder(
new ProjectRole(10000l, null, "Users", "A project role that represents users in a project",
ImmutableList.<RoleActor>of(
new RoleActor(10062l, "jira-users", "atlassian-group-role-actor", "jira-users",
jiraUri.resolve("/jira/secure/useravatar?size=small&avatarId=10083"))
)),
new ProjectRole(10001l, null, "Developers", "A project role that represents developers in a project",
ImmutableList.<RoleActor>of(
new RoleActor(10061l, "jira-developers", "atlassian-group-role-actor", "jira-developers",
jiraUri.resolve("/jira/secure/useravatar?size=small&avatarId=10083")),
new RoleActor(10063l, "My Test User", "atlassian-user-role-actor", "user",
jiraUri.resolve("/jira/secure/useravatar?size=small&avatarId=10082"))
)),
new ProjectRole(10002l, null, "Administrators", "A project role that represents administrators in a project",
ImmutableList.<RoleActor>of(
new RoleActor(10060l, "jira-administrators", "atlassian-group-role-actor", "jira-administrators",
jiraUri.resolve("/jira/secure/useravatar?size=small&avatarId=10083"))
))
));