Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add test
  • Loading branch information
heowc committed Feb 22, 2022
commit e1a5734353ef2fbd342da972e5cbfaf98c27c094
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,22 @@ b
getResponseContent().data.echoFiles == ["test", "test again"]
}

def "errors while accessing file from the request"() {
setup:
request = Spy(MockHttpServletRequest)
request.setMethod("POST")
request.setContentType("multipart/form-data, boundary=test")
// See https://github.com/apache/tomcat/blob/main/java/org/apache/catalina/connector/Request.java#L2775...L2791
request.getParts() >> { throw new IllegalStateException() }

when:
servlet.doPost(request, response)

then:
response.getStatus() == STATUS_ERROR
response.getContentLength() == 0
}

def "batched query over HTTP POST body returns data"() {
setup:
request.setContent('[{ "query": "query { echo(arg:\\"test\\") }" }, { "query": "query { echo(arg:\\"test\\") }" }]'.bytes)
Expand Down