use of org.jets3t.service.ServiceException in project cyberduck by iterate-ch.
the class S3ExceptionMappingServiceTest method testLoginFailure403.
@Test
public void testLoginFailure403() {
final ServiceException f = new ServiceException("m", "<null/>");
f.setResponseCode(403);
f.setErrorMessage("m");
f.setErrorCode("AccessDenied");
assertTrue(new S3ExceptionMappingService().map(f) instanceof AccessDeniedException);
f.setErrorCode("InvalidAccessKeyId");
assertTrue(new S3ExceptionMappingService().map(f) instanceof LoginFailureException);
f.setErrorCode("SignatureDoesNotMatch");
assertTrue(new S3ExceptionMappingService().map(f) instanceof LoginFailureException);
}
use of org.jets3t.service.ServiceException in project cyberduck by iterate-ch.
the class S3ExceptionMappingServiceTest method testCustomMessage.
@Test
public void testCustomMessage() {
assertEquals("Custom.", new S3ExceptionMappingService().map("custom", new ServiceException("message")).getMessage());
assertEquals("Message. Please contact your web hosting service provider for assistance.", new S3ExceptionMappingService().map("custom", new ServiceException("message")).getDetail());
}
Aggregations