@Test public void shouldReturnFalseWhenShouldOverrideTranslation() { String key = "key"; Locale locale = new Locale("pl"); ReflectionTestUtils.setField(translationServiceOverrideUtil, "useCustomTranslations", false); given(pluginStateResolver.isEnabled(CustomTranslationContants.PLUGIN_IDENTIFIER)).willReturn(false); given(customTranslationResolver.isCustomTranslationActive(key, locale)).willReturn(false); boolean result = translationServiceOverrideUtil.shouldOverrideTranslation(key, locale); assertFalse(result); }
public boolean shouldOverrideTranslation(final String key, final Locale locale) { return useCustomTranslations && pluginStateResolver.isEnabled(CustomTranslationContants.PLUGIN_IDENTIFIER) && customTranslationResolver.isCustomTranslationActive(key, locale); }
TranslationServiceOverrideUtil { public boolean shouldOverrideTranslation(final String key, final Locale locale) { return useCustomTranslations && pluginStateResolver.isEnabled(CustomTranslationContants.PLUGIN_IDENTIFIER) && customTranslationResolver.isCustomTranslationActive(key, locale); } }
TranslationServiceOverrideUtil { public boolean shouldOverrideTranslation(final String key, final Locale locale) { return useCustomTranslations && pluginStateResolver.isEnabled(CustomTranslationContants.PLUGIN_IDENTIFIER) && customTranslationResolver.isCustomTranslationActive(key, locale); }  }
TranslationServiceOverrideUtil { public boolean shouldOverrideTranslation(final String key, final Locale locale) { return useCustomTranslations && pluginStateResolver.isEnabled(CustomTranslationContants.PLUGIN_IDENTIFIER) && customTranslationResolver.isCustomTranslationActive(key, locale); }  boolean shouldOverrideTranslation(final String key, final Locale locale); String getCustomTranslation(final String key, final Locale locale, final String[] args); }
TranslationServiceOverrideUtil { public boolean shouldOverrideTranslation(final String key, final Locale locale) { return useCustomTranslations && pluginStateResolver.isEnabled(CustomTranslationContants.PLUGIN_IDENTIFIER) && customTranslationResolver.isCustomTranslationActive(key, locale); }  boolean shouldOverrideTranslation(final String key, final Locale locale); String getCustomTranslation(final String key, final Locale locale, final String[] args);  }