Created
February 16, 2017 20:06
-
-
Save ralphpina/245e7e7fe0c1761de0f3275ae8875eb5 to your computer and use it in GitHub Desktop.
injecting application component into the Application subclass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Needed to replace the component with a test specific one | |
@VisibleForTesting | |
public void setComponent(ApplicationComponent applicationComponent) { | |
this.applicationComponent = applicationComponent; | |
// we need to inject again, otherwise the objects here are the originals | |
// not the test ones as one would expect R.Pina 20160105 | |
this.applicationComponent.inject(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment