Tolerate changes to request body reading in Framework 5.1

Previously, MockHttpServletRequest allowed its body to be ready
multiple times using its InputStream. As of recent Spring Framework
5.1 snapshots, this is no longer the case.

This commit moves to directly accessing the request's content as a
byte array using getContentAsByteArray() which was introduced in
Framework 5.0.

Closes gh-515
This commit is contained in:
Andy Wilkinson
2018-06-15 16:00:25 +01:00
parent 026af2de2a
commit a60b87990b
4 changed files with 24 additions and 3 deletions

View File

@@ -14,4 +14,11 @@ dependencies {
test {
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.restdocs.*"
}
matrixTest {
springFramework {
group = 'org.springframework'
versions = ['5.1.0.BUILD-SNAPSHOT']
}
}