use of com.palantir.atlasdb.http.errors.AtlasDbRemoteException in project atlasdb by palantir.
the class SerializableErrorDecoderTest method assertHasErrorName.
private static void assertHasErrorName(Throwable exception, String expectedErrorName) {
AtlasDbRemoteException remoteException = (AtlasDbRemoteException) exception;
assertThat(remoteException.getErrorName()).isEqualTo(expectedErrorName);
}
use of com.palantir.atlasdb.http.errors.AtlasDbRemoteException in project atlasdb by palantir.
the class AsyncTimelockServiceIntegrationTest method assertBadRequest.
private static void assertBadRequest(ThrowableAssert.ThrowingCallable throwingCallable) {
assertThatThrownBy(throwingCallable).isInstanceOf(AtlasDbRemoteException.class).satisfies(remoteException -> {
AtlasDbRemoteException atlasDbRemoteException = (AtlasDbRemoteException) remoteException;
assertThat(atlasDbRemoteException.getErrorName()).isEqualTo(BadRequestException.class.getCanonicalName());
assertThat(atlasDbRemoteException.getStatus()).isEqualTo(HttpStatus.BAD_REQUEST_400);
});
}
use of com.palantir.atlasdb.http.errors.AtlasDbRemoteException in project atlasdb by palantir.
the class PaxosTimeLockServerIntegrationTest method assertRemoteExceptionWithStatus.
private static void assertRemoteExceptionWithStatus(Throwable throwable, int expectedStatus) {
assertThat(throwable).isInstanceOf(AtlasDbRemoteException.class);
AtlasDbRemoteException remoteException = (AtlasDbRemoteException) throwable;
assertThat(remoteException.getStatus()).isEqualTo(expectedStatus);
}
use of com.palantir.atlasdb.http.errors.AtlasDbRemoteException in project atlasdb by palantir.
the class PaxosTimeLockServerIntegrationTest method lockServiceShouldDisallowGettingMinLockedInVersionId.
@Test
public void lockServiceShouldDisallowGettingMinLockedInVersionId() {
LockService lockService = getLockService(CLIENT_1);
assertThatThrownBy(() -> lockService.getMinLockedInVersionId(CLIENT_1)).isInstanceOf(AtlasDbRemoteException.class).satisfies(remoteException -> {
AtlasDbRemoteException atlasDbRemoteException = (AtlasDbRemoteException) remoteException;
assertThat(atlasDbRemoteException.getErrorName()).isEqualTo(BadRequestException.class.getCanonicalName());
assertThat(atlasDbRemoteException.getStatus()).isEqualTo(HttpStatus.BAD_REQUEST_400);
});
}
Aggregations