Fixing the build setup of samples
We want them to be real samples so I've added proper stub generation tasks
This commit is contained in:
@@ -9,10 +9,10 @@ import static org.gradle.testkit.runner.TaskOutcome.UP_TO_DATE
|
||||
@Stepwise
|
||||
class BasicFunctionalSpec extends AccurestIntegrationSpec {
|
||||
|
||||
private static final String GENERATED_TEST = "build//generated-test-sources//accurest//accurest//twitter_places_analyzer//PairIdSpec.groovy"
|
||||
private static final String GENERATED_CLIENT_JSON_STUB = "build//production//bootSimple-stubs//repository//mappings//twitter-places-analyzer//pairId//collerate_PlacesFrom_Tweet.json"
|
||||
private static final String GENERATED_TEST = "build//generated-test-sources//accurest//accurest//com//ofg//twitter_places_analyzer//PairIdSpec.groovy"
|
||||
private static final String GENERATED_CLIENT_JSON_STUB = "build//production//bootSimple-stubs//repository//mappings//com//ofg//twitter-places-analyzer//pairId//collerate_PlacesFrom_Tweet.json"
|
||||
private static final String GROOVY_DSL_CONTRACT = "repository//mappings//com//ofg//twitter-places-analyzer//pairId//collerate_PlacesFrom_Tweet.groovy"
|
||||
private static final String TEST_EXECUTION_XML_REPORT = "build/test-results/TEST-accurest.twitter_places_analyzer.PairIdSpec.xml"
|
||||
private static final String TEST_EXECUTION_XML_REPORT = "build/test-results/TEST-accurest.com.ofg.twitter_places_analyzer.PairIdSpec.xml"
|
||||
|
||||
def setup() {
|
||||
setupForProject("functionalTest/bootSimple")
|
||||
|
||||
@@ -6,11 +6,13 @@ buildscript {
|
||||
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: 'accurest'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
ext {
|
||||
contractsDir = file("${project.rootDir}/repository/mappings/com/ofg")
|
||||
wireMockStubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
|
||||
wireMockStubsOutputDir = new File(wireMockStubsOutputDirRoot, 'repository/mappings/')
|
||||
contractsDir = file("${project.rootDir}/repository/mappings/")
|
||||
stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
|
||||
wireMockStubsOutputDir = new File(stubsOutputDirRoot, 'repository/mappings/')
|
||||
contractsOutputDir = new File(stubsOutputDirRoot, 'repository/accurest/')
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -65,3 +67,32 @@ generateAccurest.dependsOn generateWireMockClientStubs
|
||||
wrapper {
|
||||
gradleVersion '2.2.1'
|
||||
}
|
||||
|
||||
task copyContracts(type: Copy) {
|
||||
from contractsDir
|
||||
into contractsOutputDir
|
||||
}
|
||||
|
||||
task stubsJar(type: Jar, dependsOn: ["generateWireMockClientStubs", copyContracts]) {
|
||||
baseName = "${project.name}-stubs"
|
||||
from stubsOutputDirRoot
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives stubsJar
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
stubs(MavenPublication) {
|
||||
artifactId "${project.name}-stubs"
|
||||
artifact stubsJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
testLogging {
|
||||
exceptionFormat = 'full'
|
||||
}
|
||||
}
|
||||
@@ -103,3 +103,9 @@ publishing {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
testLogging {
|
||||
exceptionFormat = 'full'
|
||||
}
|
||||
}
|
||||
@@ -35,10 +35,13 @@ subprojects {
|
||||
configure([project(':fraudDetectionService'), project(':loanApplicationService')]) {
|
||||
apply plugin: 'spring-boot'
|
||||
apply plugin: 'accurest'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
ext {
|
||||
wireMockStubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
|
||||
wireMockStubsOutputDir = new File(wireMockStubsOutputDirRoot, 'mappings/')
|
||||
contractsDir = file("${project.rootDir}/repository/mappings/")
|
||||
stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
|
||||
wireMockStubsOutputDir = new File(stubsOutputDirRoot, 'repository/mappings/')
|
||||
contractsOutputDir = new File(stubsOutputDirRoot, 'repository/accurest/')
|
||||
}
|
||||
|
||||
accurest {
|
||||
@@ -75,6 +78,35 @@ configure([project(':fraudDetectionService'), project(':loanApplicationService')
|
||||
|
||||
clean.dependsOn('cleanup')
|
||||
|
||||
task copyContracts(type: Copy) {
|
||||
from contractsDir
|
||||
into contractsOutputDir
|
||||
}
|
||||
|
||||
task stubsJar(type: Jar, dependsOn: ["generateWireMockClientStubs", copyContracts]) {
|
||||
baseName = "${project.name}-stubs"
|
||||
from stubsOutputDirRoot
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives stubsJar
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
stubs(MavenPublication) {
|
||||
artifactId "${project.name}-stubs"
|
||||
artifact stubsJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
testLogging {
|
||||
exceptionFormat = 'full'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
configure(project(':fraudDetectionService')) {
|
||||
@@ -85,7 +117,7 @@ configure(project(':loanApplicationService')) {
|
||||
|
||||
task copyCollaboratorStubs(type: Copy) {
|
||||
File fraudBuildDir = project(':fraudDetectionService').buildDir
|
||||
from(new File(fraudBuildDir, "/production/${project(':fraudDetectionService').name}-stubs/"))
|
||||
from(new File(fraudBuildDir, "/production/${project(':fraudDetectionService').name}-stubs/repository/"))
|
||||
into "src/test/resources/"
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,13 @@ subprojects {
|
||||
configure([project(':fraudDetectionService'), project(':loanApplicationService')]) {
|
||||
apply plugin: 'spring-boot'
|
||||
apply plugin: 'accurest'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
ext {
|
||||
wireMockStubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
|
||||
wireMockStubsOutputDir = new File(wireMockStubsOutputDirRoot, 'mappings/')
|
||||
contractsDir = file("${project.rootDir}/repository/mappings/")
|
||||
stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
|
||||
wireMockStubsOutputDir = new File(stubsOutputDirRoot, 'repository/mappings/')
|
||||
contractsOutputDir = new File(stubsOutputDirRoot, 'repository/accurest/')
|
||||
}
|
||||
|
||||
accurest {
|
||||
@@ -73,6 +76,34 @@ configure([project(':fraudDetectionService'), project(':loanApplicationService')
|
||||
|
||||
clean.dependsOn('cleanup')
|
||||
|
||||
task copyContracts(type: Copy) {
|
||||
from contractsDir
|
||||
into contractsOutputDir
|
||||
}
|
||||
|
||||
task stubsJar(type: Jar, dependsOn: ["generateWireMockClientStubs", copyContracts]) {
|
||||
baseName = "${project.name}-stubs"
|
||||
from stubsOutputDirRoot
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives stubsJar
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
stubs(MavenPublication) {
|
||||
artifactId "${project.name}-stubs"
|
||||
artifact stubsJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
testLogging {
|
||||
exceptionFormat = 'full'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configure(project(':fraudDetectionService')) {
|
||||
@@ -83,7 +114,7 @@ configure(project(':loanApplicationService')) {
|
||||
|
||||
task copyCollaboratorStubs(type: Copy) {
|
||||
File fraudBuildDir = project(':fraudDetectionService').buildDir
|
||||
from(new File(fraudBuildDir, "/production/${project(':fraudDetectionService').name}-stubs/"))
|
||||
from(new File(fraudBuildDir, "/production/${project(':fraudDetectionService').name}-stubs/repository/"))
|
||||
into "src/test/resources/"
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ ext {
|
||||
|
||||
subprojects {
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -37,8 +38,10 @@ configure([project(':fraudDetectionService'), project(':loanApplicationService')
|
||||
apply plugin: 'accurest'
|
||||
|
||||
ext {
|
||||
wireMockStubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
|
||||
wireMockStubsOutputDir = new File(wireMockStubsOutputDirRoot, 'mappings/')
|
||||
contractsDir = file("${project.rootDir}/repository/mappings/")
|
||||
stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
|
||||
wireMockStubsOutputDir = new File(stubsOutputDirRoot, 'repository/mappings/')
|
||||
contractsOutputDir = new File(stubsOutputDirRoot, 'repository/accurest/')
|
||||
}
|
||||
|
||||
accurest {
|
||||
@@ -73,6 +76,34 @@ configure([project(':fraudDetectionService'), project(':loanApplicationService')
|
||||
|
||||
clean.dependsOn('cleanup')
|
||||
|
||||
task copyContracts(type: Copy) {
|
||||
from contractsDir
|
||||
into contractsOutputDir
|
||||
}
|
||||
|
||||
task stubsJar(type: Jar, dependsOn: ["generateWireMockClientStubs", copyContracts]) {
|
||||
baseName = "${project.name}-stubs"
|
||||
from stubsOutputDirRoot
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives stubsJar
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
stubs(MavenPublication) {
|
||||
artifactId "${project.name}-stubs"
|
||||
artifact stubsJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
testLogging {
|
||||
exceptionFormat = 'full'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configure(project(':fraudDetectionService')) {
|
||||
@@ -83,7 +114,7 @@ configure(project(':loanApplicationService')) {
|
||||
|
||||
task copyCollaboratorStubs(type: Copy) {
|
||||
File fraudBuildDir = project(':fraudDetectionService').buildDir
|
||||
from(new File(fraudBuildDir, "/production/${project(':fraudDetectionService').name}-stubs/"))
|
||||
from(new File(fraudBuildDir, "/production/${project(':fraudDetectionService').name}-stubs/repository/"))
|
||||
into "src/test/resources/"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user