use of com.enonic.xp.i18n.MessageBundle in project xp by enonic.
the class I18NScriptTest method initialize.
@Override
protected void initialize() throws Exception {
super.initialize();
final LocaleService localeService = Mockito.mock(LocaleService.class);
final Set<Locale> locales = new LinkedHashSet<>();
locales.add(new Locale("en"));
locales.add(new Locale("es"));
locales.add(new Locale("ca"));
Mockito.when(localeService.getLocales(any(ApplicationKey.class), any())).thenReturn(locales);
final MessageBundle bundle = Mockito.mock(MessageBundle.class, this::answer);
Mockito.when(localeService.getBundle(any(ApplicationKey.class), any(Locale.class), any())).thenReturn(bundle);
addService(LocaleService.class, localeService);
getPortalRequest().setSite(Site.create().name(ContentName.from("test")).parentPath(ContentPath.ROOT).language(Locale.ENGLISH).build());
}
Aggregations