Search in sources :

Example 6 with CredentialVerificationException

use of com.sequenceiq.environment.credential.exception.CredentialVerificationException in project cloudbreak by hortonworks.

the class SearchCauseExceptionMapperTest method testGetResponseStatusWhenHasOneDepthsCauseWithDefaultMapper.

@Test
public void testGetResponseStatusWhenHasOneDepthsCauseWithDefaultMapper() {
    Response.Status actual = underTest.getResponseStatus(new CredentialVerificationException("", new Exception()));
    Assertions.assertEquals(Response.Status.BAD_REQUEST, actual);
}
Also used : Response(javax.ws.rs.core.Response) CredentialVerificationException(com.sequenceiq.environment.credential.exception.CredentialVerificationException) CredentialVerificationException(com.sequenceiq.environment.credential.exception.CredentialVerificationException) NotFoundException(javax.ws.rs.NotFoundException) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 7 with CredentialVerificationException

use of com.sequenceiq.environment.credential.exception.CredentialVerificationException in project cloudbreak by hortonworks.

the class SearchCauseExceptionMapperTest method testGetResponseStatusWhenHasOnlyOneCause.

@Test
public void testGetResponseStatusWhenHasOnlyOneCause() {
    Response.Status actual = underTest.getResponseStatus(new CredentialVerificationException("", new NotFoundException()));
    Assertions.assertEquals(Response.Status.NOT_FOUND, actual);
}
Also used : Response(javax.ws.rs.core.Response) NotFoundException(javax.ws.rs.NotFoundException) CredentialVerificationException(com.sequenceiq.environment.credential.exception.CredentialVerificationException) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 8 with CredentialVerificationException

use of com.sequenceiq.environment.credential.exception.CredentialVerificationException in project cloudbreak by hortonworks.

the class SearchCauseExceptionMapperTest method testGetResponseStatusWhenHasTwoDepthsCauseWithDefaultMapper.

@Test
public void testGetResponseStatusWhenHasTwoDepthsCauseWithDefaultMapper() {
    Response.Status actual = underTest.getResponseStatus(new CredentialVerificationException("", new Exception(new Exception())));
    Assertions.assertEquals(Response.Status.BAD_REQUEST, actual);
}
Also used : Response(javax.ws.rs.core.Response) CredentialVerificationException(com.sequenceiq.environment.credential.exception.CredentialVerificationException) CredentialVerificationException(com.sequenceiq.environment.credential.exception.CredentialVerificationException) NotFoundException(javax.ws.rs.NotFoundException) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

CredentialVerificationException (com.sequenceiq.environment.credential.exception.CredentialVerificationException)8 Response (javax.ws.rs.core.Response)7 Test (org.junit.jupiter.api.Test)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 NotFoundException (javax.ws.rs.NotFoundException)6 CloudContext (com.sequenceiq.cloudbreak.cloud.context.CloudContext)1 CredentialVerificationRequest (com.sequenceiq.cloudbreak.cloud.event.credential.CredentialVerificationRequest)1 CredentialVerificationResult (com.sequenceiq.cloudbreak.cloud.event.credential.CredentialVerificationResult)1 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)1 CloudCredentialStatus (com.sequenceiq.cloudbreak.cloud.model.CloudCredentialStatus)1 ExtendedCloudCredential (com.sequenceiq.cloudbreak.cloud.model.ExtendedCloudCredential)1 OperationException (com.sequenceiq.cloudbreak.service.OperationException)1 CredentialVerification (com.sequenceiq.environment.credential.verification.CredentialVerification)1