Skip to content

Commit

Permalink
PWTI-434 add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dariusz Kordonski committed Jan 10, 2021
1 parent b3299c7 commit 2037fa4
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/test/groovy/JooqDockerPluginSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,47 @@ class JooqDockerPluginSpec extends Specification {
Files.notExists(generatedFlywayClass)
}


def "exclude flyway schema history given custom Flyway table name"() {
given:
prepareBuildGradleFile("""
plugins {
id("com.revolut.jooq-docker")
}
repositories {
jcenter()
}
tasks {
generateJooqClasses {
excludeFlywayTable = true
flywayProperties = mapOf("flyway.table" to "some_schema_table")
}
}
dependencies {
jdbc("org.postgresql:postgresql:42.2.5")
}
""")
copyResource("/V01__init.sql", "src/main/resources/db/migration/V01__init.sql")

when:
def result = GradleRunner.create()
.withProjectDir(projectDir)
.withPluginClasspath()
.withArguments("generateJooqClasses")
.build()

then:
result.task(":generateJooqClasses").outcome == SUCCESS
def generatedFooClass = Paths.get(projectDir.getPath(), "build/generated-jooq/org/jooq/generated/tables/Foo.java")
def generatedCustomFlywayClass = Paths.get(projectDir.getPath(), "build/generated-jooq/org/jooq/generated/tables/SomeSchemaTable.java")
Files.exists(generatedFooClass)
Files.notExists(generatedCustomFlywayClass)
}


def "exclude flyway schema history without overriding existing excludes"() {
given:
prepareBuildGradleFile("""
Expand Down

0 comments on commit 2037fa4

Please sign in to comment.