@Test public void shouldChangeActiveStateIfPluginIsEnabledAndCustomTranslationIsntNull() { String plugin = "plugin"; String translation = "translation"; given(customTranslation.getStringField(PLUGIN_IDENTIFIER)).willReturn(plugin); given(customTranslation.getStringField(CUSTOM_TRANSLATION)).willReturn(translation); given(pluginStateResolver.isEnabled(plugin)).willReturn(true); customTranslationModelHooks.changeActiveState(customTranslationDD, customTranslation); verify(customTranslation).setField(ACTIVE, true); }
public void changeActiveState(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); String translation = customTranslation.getStringField(CUSTOM_TRANSLATION); if (pluginStateResolver.isEnabled(pluginIdentifier)) { customTranslation.setField(ACTIVE, (translation != null)); } }
CustomTranslationModelHooks { public void changeActiveState(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); String translation = customTranslation.getStringField(CUSTOM_TRANSLATION); if (pluginStateResolver.isEnabled(pluginIdentifier)) { customTranslation.setField(ACTIVE, (translation != null)); } } }
CustomTranslationModelHooks { public void changeActiveState(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); String translation = customTranslation.getStringField(CUSTOM_TRANSLATION); if (pluginStateResolver.isEnabled(pluginIdentifier)) { customTranslation.setField(ACTIVE, (translation != null)); } }  }
CustomTranslationModelHooks { public void changeActiveState(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); String translation = customTranslation.getStringField(CUSTOM_TRANSLATION); if (pluginStateResolver.isEnabled(pluginIdentifier)) { customTranslation.setField(ACTIVE, (translation != null)); } }  boolean checkIfCustomTranslationIsUnique(final DataDefinition customTranslationDD, final Entity customTranslation); void changeActiveState(final DataDefinition customTranslationDD, final Entity customTranslation); void updateCache(final DataDefinition customTranslationDD, final Entity customTranslation); }
CustomTranslationModelHooks { public void changeActiveState(final DataDefinition customTranslationDD, final Entity customTranslation) { String pluginIdentifier = customTranslation.getStringField(PLUGIN_IDENTIFIER); String translation = customTranslation.getStringField(CUSTOM_TRANSLATION); if (pluginStateResolver.isEnabled(pluginIdentifier)) { customTranslation.setField(ACTIVE, (translation != null)); } }  boolean checkIfCustomTranslationIsUnique(final DataDefinition customTranslationDD, final Entity customTranslation); void changeActiveState(final DataDefinition customTranslationDD, final Entity customTranslation); void updateCache(final DataDefinition customTranslationDD, final Entity customTranslation);  }