Code example for PropertyResourceBundle

0
    private ResourceBundle ruBundle;
 
    @BeforeClass 
    public void loadBundles() throws Exception{
        enBundle = new PropertyResourceBundle(new StringReader(EN_PROP));
        ruBundle = new PropertyResourceBundle(new StringReader(RU_PROP));
    } 
 
    @BeforeMethod 
    public void init() { 
        MockitoAnnotations.initMocks(this);
        doReturn(enBundle).when(parser).getBundle(eq(Locale.forLanguageTag("en")));
        doReturn(ruBundle).when(parser).getBundle(eq(Locale.forLanguageTag("ru")));
        when(wrapper.getCharacterEncoding()).thenReturn("UTF-8");
    } 
 
 
    @Test
    public void testParse() throws Exception {
        when(wrapper.getByteArray()).thenReturn("test <jcommune:message></jcommune:message>".getBytes());