Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onCreate() {
- if TEST == true {
- use mock object and update it manually.
- -- mockedObject
- } else if TEST == false {
- use real object and update it using http calls.
- -- real Object
- }
- }
- testMock() {
- try {
- AndroidApplication application = Mockito.mock(AndroidApplication.class);
- context.startActivity(intent);
- mDevice.wait(Until.hasObject(By.pkg(TARGET_PACKAGE).depth(0)), Constants.LAUNCH_TIMEOUT);
- Mockito.when(application.getThreadObject()).thenReturn(mockObject);
- } catch(MockException m){
- m.printStackTracke();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement