Files
spring-restdocs/spring-restdocs-core/build.gradle
Paul-Christian Volkmer d329e2da5d Use -u 'username:password' for basic auth in the curl request snippet
Previously, when a request was made that used basic auth, the curl
snippet would configure the authentication header with the
Base64-encoded header. This commit updates the snippet to use the
more human-friendly -u option to provide the username and password
in place of the authentication header.

Closes gh-122
2015-09-16 15:44:31 -04:00

60 lines
1.7 KiB
Groovy

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 'junit:junit'
compile 'org.springframework:spring-webmvc'
compile 'javax.servlet:javax.servlet-api'
compile 'commons-codec:commons-codec:1.10'
compile files(jmustacheRepackJar)
jarjar 'com.googlecode.jarjar:jarjar:1.3'
jmustache 'com.samskivert:jmustache@jar'
optional 'javax.validation:validation-api'
testCompile 'org.mockito:mockito-core'
testCompile 'org.hamcrest:hamcrest-core'
testCompile 'org.hamcrest:hamcrest-library'
testCompile 'org.hibernate:hibernate-validator'
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.*"
}