Switch test to use a specific locale for which we have a message file (french). The default ResourceBundle behaviour is to attempt to load the platform locale if the specified one isn't found before using the default. We don't have a messages_en.properties file, hence trying to use "en" locale on a Chinese computer will result in Chinese messages being used (and test failing).
This commit is contained in:
parent
650a5467e8
commit
92bc57eefd
|
@ -51,12 +51,12 @@ public class SpringSecurityMessageSourceTests extends TestCase {
|
||||||
public void testReplacableLookup() {
|
public void testReplacableLookup() {
|
||||||
// Change Locale to English
|
// Change Locale to English
|
||||||
Locale before = LocaleContextHolder.getLocale();
|
Locale before = LocaleContextHolder.getLocale();
|
||||||
LocaleContextHolder.setLocale(Locale.ENGLISH);
|
LocaleContextHolder.setLocale(Locale.FRENCH);
|
||||||
|
|
||||||
// Cause a message to be generated
|
// Cause a message to be generated
|
||||||
MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
|
MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
|
||||||
assertEquals("Missing mandatory digest value; received header FOOBAR",
|
assertEquals("Le jeton nonce est compromis FOOBAR",
|
||||||
messages.getMessage("DigestProcessingFilter.missingMandatory", new Object[] {"FOOBAR"},
|
messages.getMessage("DigestProcessingFilter.nonceCompromised", new Object[] {"FOOBAR"},
|
||||||
"ERROR - FAILED TO LOOKUP"));
|
"ERROR - FAILED TO LOOKUP"));
|
||||||
|
|
||||||
// Revert to original Locale
|
// Revert to original Locale
|
||||||
|
|
Loading…
Reference in New Issue