If i mock the client (MockClient) and return an ErrorObject. The mappedErrorObject is null due to Nullpointer Exception in the mappError method.
The Nullpointer is produced by the config in the try catch block (see below) (config = null) so the objectMapper can't be called on the object and the method returns null.
Expected behavior
The errorResponseDTO is returned when calling
Unirest.get(url).asObject(ItemDTO.class).mapError(ErrorResponseDTO.class)
but its null.
If i mock the client (MockClient) and return an ErrorObject. The mappedErrorObject is null due to Nullpointer Exception in the mappError method.
The Nullpointer is produced by the config in the try catch block (see below) (config = null) so the objectMapper can't be called on the object and the method returns null.
The mappedError is still null even if i return a ResponseBody.
To Reproduce
Expected behavior The errorResponseDTO is returned when calling
Unirest.get(url).asObject(ItemDTO.class).mapError(ErrorResponseDTO.class)
but its null.Environmental Data: