Skip to content

Commit

Permalink
Use testFixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
pboos committed Nov 4, 2024
1 parent 0ec548c commit 12f0c4a
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 36 deletions.
4 changes: 2 additions & 2 deletions spring-boot-starter/spring-boot-starter-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ dependencies {
// TODO use spotbugs instead and also apply to all modules?
implementation(libs.find.bugs)

testImplementation project(':test:test-utils')
testImplementation project(':test:openapi-web')
testImplementation(testFixtures(project(':test:test-utils')))
testImplementation(testFixtures(project(':test:openapi-web')))
testImplementation 'org.springframework:spring-web'
testImplementation 'org.springframework:spring-webmvc'
testImplementation 'org.apache.tomcat.embed:tomcat-embed-core' // For jakarta.servlet.ServletContext
Expand Down
4 changes: 2 additions & 2 deletions spring-boot-starter/spring-boot-starter-webflux/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ dependencies {
// TODO use spotbugs instead and also apply to all modules?
implementation(libs.find.bugs)

testImplementation project(':test:test-utils')
testImplementation project(':test:openapi-webflux')
testImplementation(testFixtures(project(':test:test-utils')))
testImplementation(testFixtures(project(':test:openapi-webflux')))
testImplementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.apache.tomcat.embed:tomcat-embed-core' // For jakarta.servlet.ServletContext
Expand Down
28 changes: 15 additions & 13 deletions test/openapi-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@ import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
id 'java-library'
id 'java-test-fixtures'
alias(libs.plugins.spring.boot) apply false
alias(libs.plugins.openapi.generator)
}

dependencies {
implementation platform(SpringBootPlugin.BOM_COORDINATES)
testFixturesImplementation platform(SpringBootPlugin.BOM_COORDINATES)

compileOnly project(':openapi-validation-api')
compileOnly project(':openapi-validation-core')
testFixturesCompileOnly project(':openapi-validation-api')
testFixturesCompileOnly project(':openapi-validation-core')

compileOnly 'org.springframework.boot:spring-boot-starter'
compileOnly 'org.springframework:spring-web'
testFixturesCompileOnly 'org.springframework.boot:spring-boot-starter'
testFixturesCompileOnly 'org.springframework:spring-web'

// TODO use spotbugs instead and also apply to all modules?
implementation(libs.find.bugs)
testFixturesImplementation(libs.find.bugs)

api 'org.springframework.boot:spring-boot-starter-test'
testFixturesApi platform(SpringBootPlugin.BOM_COORDINATES)
testFixturesApi 'org.springframework.boot:spring-boot-starter-test'
// For openapi generated code
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation(libs.openapi.tools.jacksonDatabindNullable)
implementation(libs.jakarta.validation.api)
implementation(libs.swagger.annotations)
api 'org.apache.tomcat.embed:tomcat-embed-core' // For jakarta.servlet.ServletContext
testFixturesApi 'org.springframework.boot:spring-boot-starter-validation'
testFixturesApi(libs.openapi.tools.jacksonDatabindNullable)
testFixturesApi(libs.jakarta.validation.api)
testFixturesApi(libs.swagger.annotations)
testFixturesApi 'org.apache.tomcat.embed:tomcat-embed-core' // For jakarta.servlet.ServletContext
}


def generatedSourceDirectory = "$buildDir/generated/openapi"
sourceSets {
main {
testFixtures {
java {
srcDir generatedSourceDirectory + '/src/main/java'
}
Expand Down
28 changes: 15 additions & 13 deletions test/openapi-webflux/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@ import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
id 'java-library'
id 'java-test-fixtures'
alias(libs.plugins.spring.boot) apply false
alias(libs.plugins.openapi.generator)
}

dependencies {
implementation platform(SpringBootPlugin.BOM_COORDINATES)
testFixturesImplementation platform(SpringBootPlugin.BOM_COORDINATES)

compileOnly project(':openapi-validation-api')
compileOnly project(':openapi-validation-core')
testFixturesCompileOnly project(':openapi-validation-api')
testFixturesCompileOnly project(':openapi-validation-core')

compileOnly 'org.springframework.boot:spring-boot-starter'
compileOnly 'org.springframework:spring-webflux'
testFixturesCompileOnly 'org.springframework.boot:spring-boot-starter'
testFixturesCompileOnly 'org.springframework:spring-webflux'

// TODO use spotbugs instead and also apply to all modules?
implementation(libs.find.bugs)
testFixturesImplementation(libs.find.bugs)

api 'org.springframework.boot:spring-boot-starter-test'
testFixturesApi platform(SpringBootPlugin.BOM_COORDINATES)
testFixturesApi 'org.springframework.boot:spring-boot-starter-test'
// For openapi generated code
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation(libs.openapi.tools.jacksonDatabindNullable)
implementation(libs.jakarta.validation.api)
implementation(libs.swagger.annotations)
api 'org.apache.tomcat.embed:tomcat-embed-core' // For jakarta.servlet.ServletContext
testFixturesApi 'org.springframework.boot:spring-boot-starter-validation'
testFixturesApi(libs.openapi.tools.jacksonDatabindNullable)
testFixturesApi(libs.jakarta.validation.api)
testFixturesApi(libs.swagger.annotations)
testFixturesApi 'org.apache.tomcat.embed:tomcat-embed-core' // For jakarta.servlet.ServletContext
}


def generatedSourceDirectory = "$buildDir/generated/openapi"
sourceSets {
main {
testFixtures {
java {
srcDir generatedSourceDirectory + '/src/main/java'
}
Expand Down
16 changes: 10 additions & 6 deletions test/test-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
id 'java-library'
id 'java-test-fixtures'
alias(libs.plugins.spring.boot) apply false
}

dependencies {
implementation platform(SpringBootPlugin.BOM_COORDINATES)
testFixturesImplementation platform(SpringBootPlugin.BOM_COORDINATES)

compileOnly project(':openapi-validation-api')
compileOnly project(':openapi-validation-core')
testFixturesCompileOnly(libs.lombok)
testFixturesAnnotationProcessor(libs.lombok)

testFixturesCompileOnly project(':openapi-validation-api')
testFixturesCompileOnly project(':openapi-validation-core')

// TODO use spotbugs instead and also apply to all modules?
implementation(libs.find.bugs)
testFixturesImplementation(libs.find.bugs)

compileOnly 'org.springframework.boot:spring-boot-starter'
compileOnly 'org.springframework:spring-web'
testFixturesCompileOnly 'org.springframework.boot:spring-boot-starter'
testFixturesCompileOnly 'org.springframework:spring-web'
}

0 comments on commit 12f0c4a

Please sign in to comment.