Search in sources :

Example 21 with ServiceCodeException

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

the class ServiceCodeExceptionTest method duplicateSMIS.

@Test
public void duplicateSMIS() {
    final String ipAddress = "smis_provider_ip";
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "Duplicate NetworkSystem SMI-S provider already exists at IP address: {0}", new Object[] { ipAddress });
    assertApiBadParameters("Duplicate NetworkSystem SMI-S provider already exists at IP address: " + ipAddress, exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 22 with ServiceCodeException

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

the class ServiceCodeExceptionTest method parentNotRoot.

@Test
public void parentNotRoot() {
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "Parent tenant is not root tenant", null);
    assertApiBadParameters("Parent tenant is not root tenant", exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 23 with ServiceCodeException

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

the class ServiceCodeExceptionTest method markedForDeletion.

@Test
public void markedForDeletion() {
    final URI id = createTestId("AuthnProvider");
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "AuthnProvider {0} is marked for deletion", new Object[] { id });
    assertApiBadParameters("AuthnProvider " + id + " is marked for deletion", exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) URI(java.net.URI) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 24 with ServiceCodeException

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

the class ServiceCodeExceptionTest method cannotRegisterType.

@Test
public void cannotRegisterType() {
    final String type = "systemType";
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "Cannot register systems with type: {0}", new Object[] { type });
    assertApiBadParameters("Cannot register systems with type: " + type, exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Example 25 with ServiceCodeException

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

the class ServiceCodeExceptionTest method nameExists.

@Test
public void nameExists() {
    final ServiceCodeException exception = new ServiceCodeException(API_PARAMETER_INVALID, "A NetworkSystem with the same name already exists.", null);
    assertApiBadParameters("A NetworkSystem with the same name already exists.", exception);
}
Also used : ServiceCodeException(com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException) Test(org.junit.Test) BaseServiceCodeExceptionTest(com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)

Aggregations

ServiceCodeException (com.emc.storageos.svcs.errorhandling.resources.ServiceCodeException)37 BaseServiceCodeExceptionTest (com.emc.storageos.svcs.errorhandling.mappers.BaseServiceCodeExceptionTest)27 Test (org.junit.Test)27 URI (java.net.URI)10 Operation (com.emc.storageos.db.client.model.Operation)5 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)5 ArrayList (java.util.ArrayList)5 DataObject (com.emc.storageos.db.client.model.DataObject)4 Volume (com.emc.storageos.db.client.model.Volume)4 BlockObject (com.emc.storageos.db.client.model.BlockObject)3 DiscoveredDataObject (com.emc.storageos.db.client.model.DiscoveredDataObject)3 NamedURI (com.emc.storageos.db.client.model.NamedURI)3 MapVolume (com.emc.storageos.api.mapper.functions.MapVolume)2 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)2 StringMap (com.emc.storageos.db.client.model.StringMap)2 VirtualPool (com.emc.storageos.db.client.model.VirtualPool)2 NullColumnValueGetter.isNullURI (com.emc.storageos.db.client.util.NullColumnValueGetter.isNullURI)2 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)2 HashMap (java.util.HashMap)2 List (java.util.List)2