I used the solution given in https://stackoverflow.com/a/16250729/351903 -
@Path("api/path")
@GET
@Produces(MediaType.APPLICATION_JSON)
public ResponseEntity<String> handshakeForTxn()
{
return new ResponseEntity<String>(HttpStatus.BAD_REQUEST);
}
I still get a 200 response status -
Server responded with a response on thread XNIO-3 task-2 2 < 200 2 < Content-Type: application/json
Although the response body contains a statusCodeValue which is set to 400 -
{ "headers": {}, "body": null, "statusCode": "BAD_REQUEST", "statusCodeValue": 400 }