Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using a instance method as a proxy to the real method we can fake it to avoid calling the real method
// this method is fakable
public String getTranslation(String key, Locale locale) {
return getTranslationOld(key, locale);
}
/**
* @deprecated use instance method instead
*/
public static String getTranslationOld(String key, Locale locale) {
Object keys = getTranslationMap().get(locale.toString());
// logic ...
// etc ...
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.