Search in sources :

Example 1 with ForbiddenException

use of com.emc.storageos.svcs.errorhandling.resources.ForbiddenException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method noTenant.

@Test
public void noTenant() {
    final String userName = "userName";
    final ForbiddenException exception = APIException.forbidden.userDoesNotMapToAnyTenancy(userName);
    assertApiInsufficientPermissions("User " + userName + " does not map to any tenancy", exception);
}
Also used : ForbiddenException(com.emc.storageos.svcs.errorhandling.resources.ForbiddenException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 2 with ForbiddenException

use of com.emc.storageos.svcs.errorhandling.resources.ForbiddenException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method readingRoles.

@Test
public void readingRoles() {
    final ForbiddenException exception = APIException.forbidden.failedReadingTenantRoles(null);
    assertApiInsufficientPermissions("Failed reading tenant roles", exception);
}
Also used : ForbiddenException(com.emc.storageos.svcs.errorhandling.resources.ForbiddenException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 3 with ForbiddenException

use of com.emc.storageos.svcs.errorhandling.resources.ForbiddenException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method onlyAdmin.

@Test
public void onlyAdmin() {
    final ForbiddenException exception = APIException.forbidden.onlyAdminsCanProvisionFileSystems("system_admin", "tenant_admin");
    assertApiInsufficientPermissions("Only [system_admin, tenant_admin] can provision file systems for object", exception);
}
Also used : ForbiddenException(com.emc.storageos.svcs.errorhandling.resources.ForbiddenException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 4 with ForbiddenException

use of com.emc.storageos.svcs.errorhandling.resources.ForbiddenException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method notLogout.

@Test
public void notLogout() {
    final String userName = "userName";
    final ForbiddenException exception = APIException.forbidden.userNotPermittedToLogoutAnotherUser(userName);
    assertApiInsufficientPermissions("User " + userName + " not permitted to logout another user", exception);
}
Also used : ForbiddenException(com.emc.storageos.svcs.errorhandling.resources.ForbiddenException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 5 with ForbiddenException

use of com.emc.storageos.svcs.errorhandling.resources.ForbiddenException in project coprhd-controller by CoprHD.

the class ServiceCodeExceptionTest method readingACLs.

@Test
public void readingACLs() {
    final ForbiddenException exception = APIException.forbidden.failedReadingProjectACLs(null);
    assertApiInsufficientPermissions("Failed reading project ACLs", exception);
}
Also used : ForbiddenException(com.emc.storageos.svcs.errorhandling.resources.ForbiddenException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Aggregations

BaseServiceCodeExceptionTest (com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)8 ForbiddenException (com.emc.storageos.svcs.errorhandling.resources.ForbiddenException)8 Test (org.junit.Test)8