Class LocalizationBundleStub
- java.lang.Object
-
- org.silverpeas.core.test.extention.LocalizationBundleStub
-
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterEachCallback
,org.junit.jupiter.api.extension.BeforeEachCallback
,org.junit.jupiter.api.extension.Extension
public class LocalizationBundleStub extends Object implements org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback
Provides easy stubbing on theLocalizationBundle
in unit tests.- Author:
- silveryocha
-
-
Constructor Summary
Constructors Constructor Description LocalizationBundleStub(String bundleName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
void
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
protected void
clear()
LocalizationBundleStub
put(String key, String value)
Puts a couple key / value linked to default locale set by the extension itself.LocalizationBundleStub
put(String locale, String key, String value)
Puts a couple key / value linked to specified locale.
-
-
-
Constructor Detail
-
LocalizationBundleStub
public LocalizationBundleStub(String bundleName)
-
-
Method Detail
-
put
public LocalizationBundleStub put(String key, String value)
Puts a couple key / value linked to default locale set by the extension itself.- Parameters:
key
- the key.value
- the value.- Returns:
- itself.
-
put
public LocalizationBundleStub put(String locale, String key, String value)
Puts a couple key / value linked to specified locale.- Parameters:
locale
- the locale.key
- the key.value
- the value.- Returns:
- itself.
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
- Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
- Throws:
Exception
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
- Specified by:
afterEach
in interfaceorg.junit.jupiter.api.extension.AfterEachCallback
- Throws:
Exception
-
clear
protected void clear()
-
-