- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3k
Description
Hy guys,
I'm migrating a Spring Boot service to Quarkus, everything has been going almost 100% ok.
Describe the bug
I'm not sure if it is even a bug or I need to set up something else, but I have not been seing any problem like that, so... here am I.
In the test class, the ApiExceptionHandler (RestControllerAdvice), workes well, and all messages of success and fail are showed correctly, but when it is called by a rest client, it has not been working so well (for me).
Expected behavior
Return the custom json error message in the body.
Actual behavior
ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /payment failed, error id: 67f928e4-3de0-4468-9b66-4becc00dc4b7-1: java.lang.NullPointerException
To Reproduce
Steps to reproduce the behavior:
- Test class runs OK
- Resut test
- Test rest client fail
- Throw exception
- My ExceptionHandler
Screenshots.
- The test is executed with no problem
    @Test
    public void validate_balance_insuficient_test()  {
        PaymentDto json = new PaymentDto();
        json.setCardNumber(12345678);
        json.setSecurityCode(90);
        json.setBillAmount(new BigDecimal(5000));
        given()
            .contentType("application/json")
            .body(json)
            .post("/payment")        
        .then()
            .assertThat()   
            .statusCode(406)
            .body("message", is("There is no enough balance"))
            .log()
            .all();
The same test executed by rest client
This is the handler called in both of tests.
`@RestControllerAdvice
public class ApiExceptionHandler  {
@ExceptionHandler(PaymentException.class)
public ResponseEntity<?> handlerPaymentException(PaymentException ex) {
    MessageReturnDto messageReturn = MessageReturnDto.builder().message(ex.getMessage()).build();
    return new ResponseEntity<>(messageReturn, HttpStatus.NOT_ACCEPTABLE);
}`  
Environment:
- openjdk 11.0.7 2020-04-14
- OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
- OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)
- Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
- OS name: "mac os x", version: "10.15.5", arch: "x86_64", family: "mac"


