use of com.emc.storageos.model.errorhandling.ServiceErrorRestRep in project coprhd-controller by CoprHD.
the class ApiTestUserGroup method deleteUserGroupAndExpectFailure.
private void deleteUserGroupAndExpectFailure(URI id) {
String userGroupDeleteApi = getTestEditApi(id);
ClientResponse clientResponseUserGroupDelete = rSys.path(userGroupDeleteApi).delete(ClientResponse.class);
Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, clientResponseUserGroupDelete.getStatus());
final String partialExpectedErrorString = "Deleting or editing the domain of an user group is not allowed because";
final ServiceErrorRestRep actualErrorMsg = clientResponseUserGroupDelete.getEntity(ServiceErrorRestRep.class);
Assert.assertTrue(actualErrorMsg.getDetailedMessage().contains(partialExpectedErrorString));
}
use of com.emc.storageos.model.errorhandling.ServiceErrorRestRep in project coprhd-controller by CoprHD.
the class ApiTestUserGroup method validateUserGroupBadRequest.
private void validateUserGroupBadRequest(int expectedStatus, String expectedErrorMsg, ClientResponse actual) {
Assert.assertNotNull(actual);
Assert.assertEquals(expectedStatus, actual.getStatus());
final ServiceErrorRestRep actualErrorMsg = actual.getEntity(ServiceErrorRestRep.class);
Assert.assertTrue(actualErrorMsg.getDetailedMessage().contains(expectedErrorMsg));
}
use of com.emc.storageos.model.errorhandling.ServiceErrorRestRep in project coprhd-controller by CoprHD.
the class ApiTestAuthnProviders method validateAuthProviderBadRequest.
private void validateAuthProviderBadRequest(int expectedStatus, String expectedErrorMsg, ClientResponse actual) {
Assert.assertNotNull(actual);
Assert.assertEquals(expectedStatus, actual.getStatus());
final ServiceErrorRestRep actualErrorMsg = actual.getEntity(ServiceErrorRestRep.class);
Assert.assertTrue(actualErrorMsg.getDetailedMessage().startsWith(expectedErrorMsg));
}
use of com.emc.storageos.model.errorhandling.ServiceErrorRestRep in project coprhd-controller by CoprHD.
the class ApiTestBase method assertExpectedError.
protected void assertExpectedError(final ClientResponse actualResponse, final int expectedStatusCode, final ServiceCode expectedServiceCode, final String expectedMessage) {
Assert.assertEquals(expectedStatusCode, actualResponse.getStatus());
try {
final ServiceErrorRestRep error = actualResponse.getEntity(ServiceErrorRestRep.class);
assertServiceError(expectedServiceCode.getCode(), expectedServiceCode.getSummary(), expectedMessage, error);
} catch (final ClientHandlerException e) {
Assert.fail("Expected a ServiceError object");
}
}
use of com.emc.storageos.model.errorhandling.ServiceErrorRestRep in project coprhd-controller by CoprHD.
the class ApiTestTenants method validateTenantCreateAndEditBadRequest.
private void validateTenantCreateAndEditBadRequest(int expectedStatus, String expectedErrorMsg, ClientResponse actual) {
Assert.assertNotNull(actual);
Assert.assertEquals(expectedStatus, actual.getStatus());
final ServiceErrorRestRep actualErrorMsg = actual.getEntity(ServiceErrorRestRep.class);
Assert.assertTrue(actualErrorMsg.getDetailedMessage().startsWith(expectedErrorMsg));
}
Aggregations