From 83cb6f3c7f27be87c5de53472217b4f04ba96f63 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Tue, 5 Nov 2019 07:23:19 +0100 Subject: [PATCH] Let Liquibase smoke test pass on non-english systems See gh-18873 --- .../SampleLiquibaseApplicationTests.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java b/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java index 3c01a8fbbe..9997e53575 100644 --- a/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java @@ -17,7 +17,10 @@ package sample.liquibase; import java.net.ConnectException; +import java.util.Locale; +import org.junit.After; +import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -31,6 +34,19 @@ public class SampleLiquibaseApplicationTests { @Rule public OutputCapture outputCapture = new OutputCapture(); + private Locale defaultLocale; + + @Before + public void init() throws SecurityException { + this.defaultLocale = Locale.getDefault(); + Locale.setDefault(Locale.ENGLISH); + } + + @After + public void restoreLocale() { + Locale.setDefault(this.defaultLocale); + } + @Test public void testDefaultSettings() throws Exception { try {