You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementing complete GraphQL support involves reading the request body and considering it as the query for one special case. In a controller, this means using request.reader.text.
def index() {
def body = request.reader.text
respond body
}
In a test class the controller method is called multiple times as there are multiple tests.
This is a problem when the body is empty. When executing the second test, it fails with java.io.IOException: Stream closed. The tests are not independent.
Please note that when the body is not empty, i.e. request.json = [hello: "world"]
the tests pass.
Please also note that replacing request.reader.text with request.JSON in the controller causes the tests to pass. This is specifically for reading the body text.
The text was updated successfully, but these errors were encountered:
Implementing complete GraphQL support involves reading the request body and considering it as the query for one special case. In a controller, this means using
request.reader.text
.In a test class the controller method is called multiple times as there are multiple tests.
This is a problem when the body is empty. When executing the second test, it fails with
java.io.IOException: Stream closed
. The tests are not independent.Please note that when the body is not empty, i.e.
request.json = [hello: "world"]
the tests pass.
Please also note that replacing
request.reader.text
withrequest.JSON
in the controller causes the tests to pass. This is specifically for reading the body text.The text was updated successfully, but these errors were encountered: