use of org.springframework.context.support.MessageSourceAccessor in project gocd by gocd.
the class LocalizerTest method shouldLocalizeDurations.
@Test
public void shouldLocalizeDurations() {
CurrentLocale locale = new CurrentLocale();
ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
source.setBasename("test_message");
MessageSourceAccessor accessor = new MessageSourceAccessor(source);
Localizer localizer = new Localizer(accessor, locale);
assertThat(localizer.localize(new Duration(1000)), is("1 second"));
assertThat(localizer.localize(new Duration(0)), is(""));
locale.setLocaleString(Localizer.LOCALE_KANNADA);
assertThat(localizer.localize(new Duration(1000)), is("1 second"));
}
use of org.springframework.context.support.MessageSourceAccessor in project spring-security by spring-projects.
the class AccountStatusUserDetailsChecker method setMessageSource.
/**
* @since 5.2
*/
@Override
public void setMessageSource(MessageSource messageSource) {
Assert.notNull(messageSource, "messageSource cannot be null");
this.messages = new MessageSourceAccessor(messageSource);
}
use of org.springframework.context.support.MessageSourceAccessor in project spring-security by spring-projects.
the class AbstractUserDetailsReactiveAuthenticationManager method setMessageSource.
/**
* @since 5.5
*/
@Override
public void setMessageSource(MessageSource messageSource) {
Assert.notNull(messageSource, "messageSource cannot be null");
this.messages = new MessageSourceAccessor(messageSource);
}
use of org.springframework.context.support.MessageSourceAccessor in project spring-security by spring-projects.
the class AnonymousAuthenticationProvider method setMessageSource.
@Override
public void setMessageSource(MessageSource messageSource) {
Assert.notNull(messageSource, "messageSource cannot be null");
this.messages = new MessageSourceAccessor(messageSource);
}
use of org.springframework.context.support.MessageSourceAccessor in project spring-security by spring-projects.
the class JdbcDaoImpl method setMessageSource.
@Override
public void setMessageSource(MessageSource messageSource) {
Assert.notNull(messageSource, "messageSource cannot be null");
this.messages = new MessageSourceAccessor(messageSource);
}
Aggregations