Search in sources :

Example 11 with Role

use of org.candlepin.model.Role in project candlepin by candlepin.

the class KatelloUserServiceAdapterTest method addUserToRole.

@Test(expected = UnsupportedOperationException.class)
public void addUserToRole() throws Exception {
    Role r = mock(Role.class);
    User user = mock(User.class);
    kusa.addUserToRole(r, user);
}
Also used : Role(org.candlepin.model.Role) User(org.candlepin.model.User) Test(org.junit.Test)

Example 12 with Role

use of org.candlepin.model.Role in project candlepin by candlepin.

the class KatelloUserServiceAdapterTest method removeUserFromRole.

@Test(expected = UnsupportedOperationException.class)
public void removeUserFromRole() throws Exception {
    Role r = mock(Role.class);
    User user = mock(User.class);
    kusa.removeUserFromRole(r, user);
}
Also used : Role(org.candlepin.model.Role) User(org.candlepin.model.User) Test(org.junit.Test)

Example 13 with Role

use of org.candlepin.model.Role in project candlepin by candlepin.

the class KatelloUserServiceAdapterTest method updateRole.

@Test(expected = UnsupportedOperationException.class)
public void updateRole() throws Exception {
    Role r = mock(Role.class);
    kusa.updateRole(r);
}
Also used : Role(org.candlepin.model.Role) Test(org.junit.Test)

Example 14 with Role

use of org.candlepin.model.Role in project candlepin by candlepin.

the class KatelloUserServiceAdapterTest method createRole.

@Test(expected = UnsupportedOperationException.class)
public void createRole() throws Exception {
    Role r = mock(Role.class);
    kusa.createRole(r);
}
Also used : Role(org.candlepin.model.Role) Test(org.junit.Test)

Example 15 with Role

use of org.candlepin.model.Role in project candlepin by candlepin.

the class OwnerResourceTest method cleanupWithOutstandingPermissions.

@Test
public void cleanupWithOutstandingPermissions() {
    PermissionBlueprint p = new PermissionBlueprint(PermissionType.OWNER, owner, Access.ALL);
    Role r = new Role("rolename");
    r.addPermission(p);
    roleCurator.create(r);
    ownerResource.deleteOwner(owner.getKey(), false, false);
}
Also used : Role(org.candlepin.model.Role) PermissionBlueprint(org.candlepin.model.PermissionBlueprint) Test(org.junit.Test)

Aggregations

Role (org.candlepin.model.Role)23 User (org.candlepin.model.User)14 Test (org.junit.Test)10 PermissionBlueprint (org.candlepin.model.PermissionBlueprint)9 Owner (org.candlepin.model.Owner)8 ApiOperation (io.swagger.annotations.ApiOperation)7 Produces (javax.ws.rs.Produces)7 ApiResponses (io.swagger.annotations.ApiResponses)6 Path (javax.ws.rs.Path)6 HashSet (java.util.HashSet)4 Consumes (javax.ws.rs.Consumes)4 LinkedList (java.util.LinkedList)3 POST (javax.ws.rs.POST)3 UserPrincipal (org.candlepin.auth.UserPrincipal)3 DELETE (javax.ws.rs.DELETE)2 Principal (org.candlepin.auth.Principal)2 OwnerPermission (org.candlepin.auth.permissions.OwnerPermission)2 Permission (org.candlepin.auth.permissions.Permission)2 UsernameConsumersPermission (org.candlepin.auth.permissions.UsernameConsumersPermission)2 NotFoundException (org.candlepin.common.exceptions.NotFoundException)2