c0483ef3d1
- POST /api/mirror (дубль-контроль по itemId), GET статус/by-item/список, DELETE (cancelled/S3-очистка) - kotlinx-сериализация, Jackson выпилен из HTTP-стека (транзитив Flyway/AWS остался) - Spring Boot 4.1.0, Kotlin 2.4.10, Flyway, Testcontainers postgres+minio - тесты: 22, LINE 92.6%, smoke против живой БД прошёл
84 lines
2.5 KiB
Kotlin
84 lines
2.5 KiB
Kotlin
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
plugins {
|
|
id("org.springframework.boot") version "4.1.0"
|
|
id("org.jetbrains.kotlin.jvm") version "2.4.10"
|
|
id("org.jetbrains.kotlin.plugin.spring") version "2.4.10"
|
|
id("org.jetbrains.kotlin.plugin.serialization") version "2.4.10"
|
|
jacoco
|
|
}
|
|
|
|
group = "pw.binom"
|
|
version = "0.0.1-SNAPSHOT"
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
jvmTarget = JvmTarget.JVM_21
|
|
freeCompilerArgs.add("-Xjsr305=strict")
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(platform("org.springframework.boot:spring-boot-dependencies:4.1.0"))
|
|
implementation("org.springframework.boot:spring-boot-starter-webmvc") {
|
|
exclude(group = "org.springframework.boot", module = "spring-boot-starter-jackson")
|
|
}
|
|
implementation(kotlin("reflect"))
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0")
|
|
implementation("org.springframework.boot:spring-boot-starter-jdbc")
|
|
implementation("org.springframework.boot:spring-boot-starter-flyway")
|
|
implementation("org.springframework.boot:spring-boot-starter-validation")
|
|
implementation("org.postgresql:postgresql")
|
|
implementation("org.flywaydb:flyway-database-postgresql")
|
|
implementation(platform("software.amazon.awssdk:bom:2.46.21"))
|
|
implementation("software.amazon.awssdk:s3")
|
|
|
|
testImplementation(platform("org.springframework.boot:spring-boot-dependencies:4.1.0"))
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
|
testImplementation("org.springframework.boot:spring-boot-webmvc-test")
|
|
testImplementation("org.testcontainers:testcontainers:1.21.4")
|
|
testImplementation("org.testcontainers:junit-jupiter:1.21.4")
|
|
testImplementation("org.testcontainers:postgresql:1.21.4")
|
|
testImplementation("org.testcontainers:minio:1.21.4")
|
|
}
|
|
|
|
tasks.withType<Test> {
|
|
useJUnitPlatform()
|
|
finalizedBy(tasks.jacocoTestReport)
|
|
}
|
|
|
|
tasks.named<org.springframework.boot.gradle.tasks.bundling.BootJar>("bootJar") {
|
|
archiveFileName.set("media-mirror-api.jar")
|
|
}
|
|
|
|
tasks.jacocoTestReport {
|
|
dependsOn(tasks.test)
|
|
reports {
|
|
xml.required = true
|
|
html.required = true
|
|
}
|
|
}
|
|
|
|
tasks.jacocoTestCoverageVerification {
|
|
dependsOn(tasks.test)
|
|
violationRules {
|
|
rule {
|
|
limit {
|
|
counter = "LINE"
|
|
value = "COVEREDRATIO"
|
|
minimum = "0.80".toBigDecimal()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.check {
|
|
dependsOn(tasks.jacocoTestCoverageVerification)
|
|
}
|