use of com.palantir.remoting2.errors.SerializableError in project atlasdb by palantir.
the class SerializableErrorDecoderTest method assertCanSerializeAndDeserializeErrorWithName.
private void assertCanSerializeAndDeserializeErrorWithName(String errorName) throws JsonProcessingException {
SerializableError serializableError = SerializableError.of(EXCEPTION_MESSAGE, errorName);
Response response = createResponseForEntity(serializableError);
Exception exception = decoder.decode(SOME_METHOD_KEY, response);
assertThat(exception).isInstanceOf(AtlasDbRemoteException.class).satisfies(remoteException -> assertHasErrorName(remoteException, errorName));
}
use of com.palantir.remoting2.errors.SerializableError in project atlasdb by palantir.
the class ExceptionMappersTest method assertSerializedFormOfRuntimeException.
private static void assertSerializedFormOfRuntimeException(Object entity) {
SerializableError error = (SerializableError) entity;
assertThat(error.getErrorName()).isEqualTo(RUNTIME_EXCEPTION.getClass().getName());
assertThat(error.getMessage()).isEqualTo(RUNTIME_EXCEPTION.getMessage());
}
Aggregations