Class 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 the LocalizationBundle in unit tests.
    Author:
    silveryocha
    • 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 interface org.junit.jupiter.api.extension.BeforeEachCallback
        Throws:
        Exception
      • afterEach

        public void afterEach​(org.junit.jupiter.api.extension.ExtensionContext context)
                       throws Exception
        Specified by:
        afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback
        Throws:
        Exception
      • clear

        protected void clear()