Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed CommandLineUtilsTest for german locale #4219

Merged
merged 4 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package liquibase.extension.testing.command

import static java.util.ResourceBundle.getBundle

import liquibase.change.ColumnConfig
import liquibase.change.ConstraintsConfig
import liquibase.change.core.AddForeignKeyConstraintChange
Expand Down Expand Up @@ -154,7 +156,7 @@ Optional Args:
cleanResources("changelog-test.xml")
}
expectedException = CommandValidationException.class
expectedExceptionMessage = "Output ChangeLogFile 'target/test-classes/changelog-test.xml' already exists!"
expectedExceptionMessage = getBundle("liquibase/i18n/liquibase-core").getString("changelogfile.already.exists").replace("%s", "target/test-classes/changelog-test.xml")
}

run "Filtering with includeObjects", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import liquibase.GlobalConfiguration
import liquibase.Scope
import spock.lang.Specification

import static java.util.ResourceBundle.getBundle

class CommandLineUtilsTest extends Specification {

private static ResourceBundle coreBundle = getBundle("liquibase/i18n/liquibase-core")

def getBanner() {
when:
String banner = Scope.child([(GlobalConfiguration.SHOW_BANNER.key): true], { ->
Expand All @@ -14,8 +18,8 @@ class CommandLineUtilsTest extends Specification {

then:
banner.contains("Get documentation at docs.liquibase.com")
banner.contains("Starting Liquibase at");
banner.contains("version ")
banner.contains(coreBundle.getString("starting.liquibase.at.timestamp").replace("%s", ""))
banner.contains(coreBundle.getString("liquibase.version.builddate").replaceFirst("%s.*", ""))
}

def "getBanner with banner disabled"() {
Expand All @@ -26,7 +30,7 @@ class CommandLineUtilsTest extends Specification {

then:
!banner.contains("Get documentation at docs.liquibase.com")
banner.contains("Starting Liquibase at");
banner.contains("version ")
banner.contains(coreBundle.getString("starting.liquibase.at.timestamp").replace("%s", ""))
banner.contains(coreBundle.getString("liquibase.version.builddate").replaceFirst("%s.*", ""))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CSVReaderTest extends Specification {

then:
def e = thrown(CsvMalformedLineException)
e.message.startsWith("Unterminated quoted field at end of CSV line")
e.lineNumber == 2

where:
separator | quote | input | notes
Expand Down