Prove placeholders work correctly.
This commit is contained in:
parent
271d5ac96c
commit
b16ce31c5b
|
@ -17,6 +17,9 @@ package org.acegisecurity;
|
|||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.context.support.MessageSourceAccessor;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
|
@ -45,4 +48,19 @@ public class AcegiMessageSourceTests extends TestCase {
|
|||
assertEquals("Proxy tickets are rejected",
|
||||
msgs.getMessage("RejectProxyTickets.reject", null, Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public void testReplacableLookup() {
|
||||
// Change Locale to English
|
||||
Locale before = LocaleContextHolder.getLocale();
|
||||
LocaleContextHolder.setLocale(Locale.ENGLISH);
|
||||
|
||||
// Cause a message to be generated
|
||||
MessageSourceAccessor messages = AcegiMessageSource.getAccessor();
|
||||
assertEquals("Missing mandatory digest value; received header FOOBAR",
|
||||
messages.getMessage("DigestProcessingFilter.missingMandatory",
|
||||
new Object[] {"FOOBAR"}, "ERROR - FAILED TO LOOKUP"));
|
||||
|
||||
// Revert to original Locale
|
||||
LocaleContextHolder.setLocale(before);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue