@Test public void shouldUpdateCustomTranslationDataWhenDataIsntNull() { String pluginIdentifier = "plugin"; String key = "key"; String locale = "pl"; String pluginName = "plugin"; String propertiesTranslation = "translation"; given(customTranslation.getStringField(PLUGIN_IDENTIFIER)).willReturn(pluginIdentifier); given(customTranslation.getStringField(KEY)).willReturn(key); given(customTranslation.getStringField(LOCALE)).willReturn(locale); given(pluginAccessor.getPlugin(pluginIdentifier)).willReturn(plugin); given(plugin.getPluginInformation()).willReturn(pluginInformation); given(pluginInformation.getName()).willReturn(pluginName); given(translationService.translate(key, new Locale(locale))).willReturn(propertiesTranslation); customTranslationModelHooksCTM.updateCustomTranslationData(customTranslationDD, customTranslation); verify(customTranslation).setField(PLUGIN_NAME, pluginName); verify(customTranslation).setField(PROPERTIES_TRANSLATION, propertiesTranslation); }
public void updateCustomTranslationData(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); customTranslation.setField(PLUGIN_NAME, getPluginName(pluginIdentifier)); }
CustomTranslationModelHooksCTM { public void updateCustomTranslationData(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); customTranslation.setField(PLUGIN_NAME, getPluginName(pluginIdentifier)); } }
CustomTranslationModelHooksCTM { public void updateCustomTranslationData(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); customTranslation.setField(PLUGIN_NAME, getPluginName(pluginIdentifier)); }  }
CustomTranslationModelHooksCTM { public void updateCustomTranslationData(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); customTranslation.setField(PLUGIN_NAME, getPluginName(pluginIdentifier)); }  void updateCustomTranslationData(final DataDefinition customTranslationDD, final Entity customTranslation); }
CustomTranslationModelHooksCTM { public void updateCustomTranslationData(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); customTranslation.setField(PLUGIN_NAME, getPluginName(pluginIdentifier)); }  void updateCustomTranslationData(final DataDefinition customTranslationDD, final Entity customTranslation);  }