Search in sources :

Example 6 with ForbiddenException

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

the class ServiceCodeExceptionTest method invalidContext.

@Test
public void invalidContext() {
    final ForbiddenException exception = APIException.forbidden.invalidSecurityContext();
    assertApiInsufficientPermissions("Invalid security context", exception);
}
Also used : ForbiddenException(com.emc.storageos.svcs.errorhandling.resources.ForbiddenException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 7 with ForbiddenException

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

the class ServiceCodeExceptionTest method insufficientPermissions.

@Test
public void insufficientPermissions() {
    final String user = "user";
    final ForbiddenException exception = APIException.forbidden.insufficientPermissionsForUser(user);
    assertApiInsufficientPermissions("Insufficient permissions for user " + 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 8 with ForbiddenException

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

the class ServiceCodeExceptionTest method internalAPI.

@Test
public void internalAPI() {
    final ForbiddenException exception = APIException.forbidden.internalAPICannotBeUsed();
    assertApiInsufficientPermissions("Internal api can not be used with public resources", 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