-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathbuild.gradle
executable file
·110 lines (94 loc) · 3.01 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
plugins {
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.asciidoctor.jvm.convert' version '2.4.0'
id 'java'
id 'jacoco'
}
group = 'ro.unibuc'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = JavaVersion.VERSION_21
}
repositories {
mavenCentral()
}
ext {
set('snippetsDir', file("build/generated-snippets"))
set('testcontainersVersion', "1.20.4")
}
dependencies {
def cucumberVersion = "7.20.1"
def junitVersion = "5.11.4"
def testcontainersVersion = "1.20.4"
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.session:spring-session-core'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.data:spring-data-mongodb'
implementation 'commons-io:commons-io:2.18.0'
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.4'
// Integration tests - test containers dependencies
testImplementation "org.testcontainers:testcontainers:$testcontainersVersion"
testImplementation "org.testcontainers:mongodb:$testcontainersVersion"
testImplementation 'org.mongodb:mongodb-driver-sync:5.0.1'
// E2E tests
runtimeOnly "org.junit.vintage:junit-vintage-engine:$junitVersion"
testImplementation "io.cucumber:cucumber-core:$cucumberVersion"
testImplementation "io.cucumber:cucumber-java:$cucumberVersion"
testImplementation "io.cucumber:cucumber-junit:$cucumberVersion"
testImplementation "io.cucumber:cucumber-spring:$cucumberVersion"
}
dependencyManagement {
imports {
mavenBom "org.testcontainers:testcontainers-bom:${testcontainersVersion}"
}
}
test {
outputs.dir snippetsDir
useJUnitPlatform {
excludeTags ("IntegrationTest", "E2E")
}
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
}
task testIT(type: Test) {
outputs.dir snippetsDir
outputs.upToDateWhen { false }
useJUnitPlatform {
includeTags "IntegrationTest"
}
}
configurations {
cucumberRuntime {
extendsFrom testImplementation
}
}
task testE2E() {
dependsOn assemble, testClasses
doLast {
providers.javaexec {
mainClass.set("io.cucumber.core.cli.Main")
classpath(configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output)
args([
'--plugin', 'pretty',
'--plugin', 'html:target/cucumber-report.html',
'--glue', 'ro.unibuc.hello.e2e.steps',
'src/test/resources'])
}
}
}
asciidoctor {
inputs.dir snippetsDir
dependsOn test
}