Created
June 6, 2016 23:27
-
-
Save mreichelt/15316b926cb66b3e9939d4f6d087cbfd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class TestApp extends OurApp { | |
@Override | |
protected void createComponents() { | |
OurTestComponent component = mock(OurTestComponent.class); | |
// fixed the memory leak by using a plain stub (without invocation tracking) | |
OurActivityLifecycleCallbacks callbacks = | |
mock(OurActivityLifecycleCallbacks.class, withSettings().stubOnly()); | |
when(component.activityLifecycleCallbacks()).thenReturn(mock(callbacks)); | |
OurApp.setComponent(component); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment