2

It seems a stupid case but I want to simulate http request connection close, and for now I could not find the way to do it.

In my server mock I implement this code

   private JsonObject setStatus(HttpServerRequest req, JsonObject content) {
    int status = getStatus();
    if (status == 499) {
        req.response()
           .close();
    } else {
        req.response()
           .setStatusCode(status);
    }
    return content;
}

Where I can specify if I want to make my server mock to close the connection.

But even doing that I still receive 200.

Any idea or suggestion?

Regards.

SOLUTION:

req.getNetSocket().close

paul
  • 12,873
  • 23
  • 91
  • 153

0 Answers0