forked from CamilYed/readable-tests-by-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (99 loc) · 3.38 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
plugins {
id "org.springframework.boot" version "2.6.2"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
id "java"
id "groovy"
id "application"
}
group = 'tech.allegro.blog'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
project.ext.versions = [
lombok : '1.18.20',
feign : '3.1.0',
spock : '2.0-groovy-3.0',
wiremock: '2.27.2',
groovy : '3.0.9'
]
configurations {
integrationTest {
extendsFrom testRuntimeClasspath
}
}
configurations.all {
resolutionStrategy {
dependencySubstitution {
substitute module('org.codehaus.groovy:groovy:3.0.8') with module("org.codehaus.groovy:groovy:${versions.groovy}")
}
}
}
dependencies {
compileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: versions.feign
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testImplementation group: 'org.spockframework', name: 'spock-core', version: versions.spock
testImplementation group: 'org.codehaus.groovy', name: 'groovy-json', version: versions.groovy
testImplementation group: 'io.github.joke', name: 'spock-mockable', version: '1.4.0'
integrationTest group: 'com.jayway.jsonpath', name: 'json-path', version: '2.6.0'
integrationTest group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
integrationTest group: 'org.spockframework', name: 'spock-spring', version: versions.spock
integrationTest group: 'org.springframework.boot', name: 'spring-boot-starter-test'
integrationTest group: 'com.github.tomakehurst', name: 'wiremock-jre8-standalone', version: versions.wiremock
}
sourceSets {
integrationTest {
groovy {
compileClasspath += main.output + test.output + project.configurations.testRuntimeClasspath + project.configurations.integrationTest
runtimeClasspath += output + compileClasspath + project.configurations.testRuntimeClasspath
srcDir {
file('src/integrationTest/groovy')
}
}
resources.srcDir file('src/integrationTest/resources')
}
}
test {
useJUnitPlatform()
include '**/*Spec.*'
include '**/*Test.*'
testLogging {
exceptionFormat = 'full'
events = ["STARTED", "PASSED", "SKIPPED", "FAILED"]
}
}
task integrationTest(type: Test) {
useJUnitPlatform()
include '**/*Spec.*'
include '**/*Test.*'
include '**/*IT.*'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
systemProperty 'spring.profiles.active', 'integration'
outputs.upToDateWhen { false }
testLogging {
exceptionFormat = 'full'
events = ["STARTED", "PASSED", "SKIPPED", "FAILED"]
}
}
check.dependsOn integrationTest
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs += ['--enable-preview']
}
tasks.withType(Test).all {
jvmArgs += '--enable-preview'
}
wrapper {
gradleVersion = '7.2'
}