@Test public void shouldntUpdateWhenUpdateCustomTranslationIfNotContainsKey() { String key = "key"; String locale = "pl"; String translation = "translation"; given(customTranslations.containsKey(key)).willReturn(false); customTranslationCacheService.updateCustomTranslation(key, locale, translation); verify(customTranslations, never()).put(key, localeAndCustomTranslation); }
@Override public void updateCustomTranslation(final String key, final String locale, final String customTranslation) { if (isCustomTranslationAdded(key)) { getTenantCustomTranslationsCache().get(key).put(locale, customTranslation); } }
CustomTranslationCacheServiceImpl implements CustomTranslationCacheService { @Override public void updateCustomTranslation(final String key, final String locale, final String customTranslation) { if (isCustomTranslationAdded(key)) { getTenantCustomTranslationsCache().get(key).put(locale, customTranslation); } } }
CustomTranslationCacheServiceImpl implements CustomTranslationCacheService { @Override public void updateCustomTranslation(final String key, final String locale, final String customTranslation) { if (isCustomTranslationAdded(key)) { getTenantCustomTranslationsCache().get(key).put(locale, customTranslation); } } CustomTranslationCacheServiceImpl(); }
CustomTranslationCacheServiceImpl implements CustomTranslationCacheService { @Override public void updateCustomTranslation(final String key, final String locale, final String customTranslation) { if (isCustomTranslationAdded(key)) { getTenantCustomTranslationsCache().get(key).put(locale, customTranslation); } } CustomTranslationCacheServiceImpl(); @Override void addCustomTranslation(final String key, final String locale, final String customTranslation); @Override void updateCustomTranslation(final String key, final String locale, final String customTranslation); @Override void manageCustomTranslation(final String key, final String locale, final String customTranslation); @Override void removeCustomTranslations(final List<String> keys); @Override String getCustomTranslation(final String key, final String locale); @Override Map<String, Map<String, String>> getCustomTranslations(); @Override boolean isCustomTranslationAdded(final String key); @Override boolean isCustomTranslationActive(final String key, final String locale); @Override void loadCustomTranslations(final List<Entity> customTranslations); }
CustomTranslationCacheServiceImpl implements CustomTranslationCacheService { @Override public void updateCustomTranslation(final String key, final String locale, final String customTranslation) { if (isCustomTranslationAdded(key)) { getTenantCustomTranslationsCache().get(key).put(locale, customTranslation); } } CustomTranslationCacheServiceImpl(); @Override void addCustomTranslation(final String key, final String locale, final String customTranslation); @Override void updateCustomTranslation(final String key, final String locale, final String customTranslation); @Override void manageCustomTranslation(final String key, final String locale, final String customTranslation); @Override void removeCustomTranslations(final List<String> keys); @Override String getCustomTranslation(final String key, final String locale); @Override Map<String, Map<String, String>> getCustomTranslations(); @Override boolean isCustomTranslationAdded(final String key); @Override boolean isCustomTranslationActive(final String key, final String locale); @Override void loadCustomTranslations(final List<Entity> customTranslations);  }