use of org.xwiki.localization.TranslationBundle in project xwiki-platform by xwiki.
the class DefaultTranslationBundleContextTest method addBundlesToCurrentContext.
@Test
public void addBundlesToCurrentContext() throws Exception {
// Map the context component manager to the test component manager for easier test setup.
when(this.mockContextComponentManagerProvider.get()).thenReturn(this.mocker);
Collection<TranslationBundle> bundles = this.mocker.getComponentUnderTest().getBundles();
// No bundles.
assertEquals(0, bundles.size());
// Add a bundle
TranslationBundle mockBundleToAdd = mock(TranslationBundle.class);
this.mocker.getComponentUnderTest().addBundle(mockBundleToAdd);
bundles = this.mocker.getComponentUnderTest().getBundles();
// Check that it was added.
assertEquals(1, bundles.size());
assertTrue(bundles.contains(mockBundleToAdd));
}
Aggregations