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
71 lines
1.9 KiB
Groovy
71 lines
1.9 KiB
Groovy
description = 'Spring REST Docs Core'
|
|
|
|
configurations {
|
|
jarjar
|
|
jmustache
|
|
testArtifacts.extendsFrom testRuntime
|
|
}
|
|
|
|
task jmustacheRepackJar(type: Jar) { repackJar ->
|
|
repackJar.baseName = "restdocs-jmustache-repack"
|
|
repackJar.version = dependencyManagement.managedVersions['com.samskivert:jmustache']
|
|
|
|
doLast() {
|
|
project.ant {
|
|
taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask",
|
|
classpath: configurations.jarjar.asPath
|
|
jarjar(destfile: repackJar.archivePath) {
|
|
configurations.jmustache.each { originalJar ->
|
|
zipfileset(src: originalJar, includes: '**/*.class')
|
|
}
|
|
rule(pattern: 'com.samskivert.**', result: 'org.springframework.restdocs.@1')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile 'com.fasterxml.jackson.core:jackson-databind'
|
|
compile 'org.springframework:spring-web'
|
|
compile files(jmustacheRepackJar)
|
|
jarjar 'com.googlecode.jarjar:jarjar:1.3'
|
|
jmustache 'com.samskivert:jmustache@jar'
|
|
optional 'commons-codec:commons-codec'
|
|
optional 'javax.validation:validation-api'
|
|
optional 'junit:junit'
|
|
optional 'org.hibernate.validator:hibernate-validator'
|
|
optional 'org.junit.jupiter:junit-jupiter-api'
|
|
testCompile 'org.javamoney:moneta'
|
|
testCompile 'org.mockito:mockito-core'
|
|
testCompile 'org.hamcrest:hamcrest-core'
|
|
testCompile 'org.hamcrest:hamcrest-library'
|
|
testCompile 'org.springframework:spring-test'
|
|
testRuntime 'org.glassfish:javax.el:3.0.0'
|
|
}
|
|
|
|
jar {
|
|
dependsOn jmustacheRepackJar
|
|
from(zipTree(jmustacheRepackJar.archivePath)) {
|
|
include "org/springframework/restdocs/**"
|
|
}
|
|
}
|
|
|
|
task testJar(type: Jar) {
|
|
classifier "test"
|
|
from sourceSets.test.output
|
|
}
|
|
|
|
artifacts {
|
|
testArtifacts testJar
|
|
}
|
|
|
|
test {
|
|
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.restdocs.*,excludes=org.springframework.restdocs.mustache.*"
|
|
}
|
|
|
|
matrixTest {
|
|
springFramework {
|
|
group = 'org.springframework'
|
|
versions = ['5.1.0.BUILD-SNAPSHOT']
|
|
}
|
|
} |