Skip to content

Commit

Permalink
Introducing separate package for test doubles
Browse files Browse the repository at this point in the history
  • Loading branch information
techyourchance committed Aug 23, 2018
1 parent 1c454c0 commit cc47120
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.techyourchance.threadposters;

import com.techyourchance.threadposter.ThreadPostersTestDouble;
import com.techyourchance.threadposter.testdoubles.ThreadPostersTestDouble;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -12,7 +12,6 @@
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void post(Runnable runnable) {
}

/**
* The only reason this method exists is that {@link UiThreadPosterTestDouble} can override
* The only reason this method exists is that UiThreadPosterTestDouble can override
* it.
*/
protected Handler getMainHandler() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.techyourchance.threadposter;
package com.techyourchance.threadposter.testdoubles;


import com.techyourchance.threadposter.BackgroundThreadPoster;

import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.SynchronousQueue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.techyourchance.threadposter;
package com.techyourchance.threadposter.testdoubles;

import com.techyourchance.threadposter.UiThreadPoster;
import com.techyourchance.threadposter.UiThreadPosterTestDouble;
import com.techyourchance.threadposter.BackgroundThreadPoster;
import com.techyourchance.threadposter.BackgroundThreadPosterTestDouble;
import com.techyourchance.threadposter.UiThreadPoster;

/**
* This class should be used in unit tests to obtain test doubles of {@link UiThreadPoster} and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.techyourchance.threadposter;
package com.techyourchance.threadposter.testdoubles;

import android.os.Handler;

import com.techyourchance.threadposter.UiThreadPoster;

import java.util.LinkedList;
import java.util.Queue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void setup() throws Exception {
mUiHandlerMock = mock(Handler.class);
SUT = new UiThreadPoster() {
@Override
Handler getMainHandler() {
protected Handler getMainHandler() {
return mUiHandlerMock;
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.techyourchance.threadposter;
package com.techyourchance.threadposter.testdoubles;


import org.junit.Before;
import org.junit.ClassRule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.techyourchance.threadposter;
package com.techyourchance.threadposter.testdoubles;

import com.techyourchance.threadposter.testdoubles.UiThreadPosterTestDouble;

import org.junit.Before;
import org.junit.Test;
Expand Down

0 comments on commit cc47120

Please sign in to comment.