diff --git a/sample/src/test/java/com/techyourchance/threadposters/FetchDataUseCaseTest.java b/sample/src/test/java/com/techyourchance/threadposters/FetchDataUseCaseTest.java index 1027710..9846c6d 100755 --- a/sample/src/test/java/com/techyourchance/threadposters/FetchDataUseCaseTest.java +++ b/sample/src/test/java/com/techyourchance/threadposters/FetchDataUseCaseTest.java @@ -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; @@ -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; diff --git a/threadposter/src/main/java/com/techyourchance/threadposter/UiThreadPoster.java b/threadposter/src/main/java/com/techyourchance/threadposter/UiThreadPoster.java index a33083f..56fc355 100755 --- a/threadposter/src/main/java/com/techyourchance/threadposter/UiThreadPoster.java +++ b/threadposter/src/main/java/com/techyourchance/threadposter/UiThreadPoster.java @@ -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() { diff --git a/threadposter/src/main/java/com/techyourchance/threadposter/BackgroundThreadPosterTestDouble.java b/threadposter/src/main/java/com/techyourchance/threadposter/testdoubles/BackgroundThreadPosterTestDouble.java similarity index 95% rename from threadposter/src/main/java/com/techyourchance/threadposter/BackgroundThreadPosterTestDouble.java rename to threadposter/src/main/java/com/techyourchance/threadposter/testdoubles/BackgroundThreadPosterTestDouble.java index f12c545..b781d38 100755 --- a/threadposter/src/main/java/com/techyourchance/threadposter/BackgroundThreadPosterTestDouble.java +++ b/threadposter/src/main/java/com/techyourchance/threadposter/testdoubles/BackgroundThreadPosterTestDouble.java @@ -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; diff --git a/threadposter/src/main/java/com/techyourchance/threadposter/ThreadPostersTestDouble.java b/threadposter/src/main/java/com/techyourchance/threadposter/testdoubles/ThreadPostersTestDouble.java similarity index 87% rename from threadposter/src/main/java/com/techyourchance/threadposter/ThreadPostersTestDouble.java rename to threadposter/src/main/java/com/techyourchance/threadposter/testdoubles/ThreadPostersTestDouble.java index 56aa1db..c8a171f 100755 --- a/threadposter/src/main/java/com/techyourchance/threadposter/ThreadPostersTestDouble.java +++ b/threadposter/src/main/java/com/techyourchance/threadposter/testdoubles/ThreadPostersTestDouble.java @@ -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 diff --git a/threadposter/src/main/java/com/techyourchance/threadposter/UiThreadPosterTestDouble.java b/threadposter/src/main/java/com/techyourchance/threadposter/testdoubles/UiThreadPosterTestDouble.java similarity index 93% rename from threadposter/src/main/java/com/techyourchance/threadposter/UiThreadPosterTestDouble.java rename to threadposter/src/main/java/com/techyourchance/threadposter/testdoubles/UiThreadPosterTestDouble.java index 5fc6f52..678c84a 100755 --- a/threadposter/src/main/java/com/techyourchance/threadposter/UiThreadPosterTestDouble.java +++ b/threadposter/src/main/java/com/techyourchance/threadposter/testdoubles/UiThreadPosterTestDouble.java @@ -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; diff --git a/threadposter/src/test/java/com/techyourchance/threadposter/UiThreadPosterTest.java b/threadposter/src/test/java/com/techyourchance/threadposter/UiThreadPosterTest.java index 9efe16b..12a00d8 100755 --- a/threadposter/src/test/java/com/techyourchance/threadposter/UiThreadPosterTest.java +++ b/threadposter/src/test/java/com/techyourchance/threadposter/UiThreadPosterTest.java @@ -22,7 +22,7 @@ public void setup() throws Exception { mUiHandlerMock = mock(Handler.class); SUT = new UiThreadPoster() { @Override - Handler getMainHandler() { + protected Handler getMainHandler() { return mUiHandlerMock; } }; diff --git a/threadposter/src/test/java/com/techyourchance/threadposter/BackgroundThreadPosterTestDoubleTest.java b/threadposter/src/test/java/com/techyourchance/threadposter/testdoubles/BackgroundThreadPosterTestDoubleTest.java similarity index 95% rename from threadposter/src/test/java/com/techyourchance/threadposter/BackgroundThreadPosterTestDoubleTest.java rename to threadposter/src/test/java/com/techyourchance/threadposter/testdoubles/BackgroundThreadPosterTestDoubleTest.java index 09d406d..02e9909 100755 --- a/threadposter/src/test/java/com/techyourchance/threadposter/BackgroundThreadPosterTestDoubleTest.java +++ b/threadposter/src/test/java/com/techyourchance/threadposter/testdoubles/BackgroundThreadPosterTestDoubleTest.java @@ -1,4 +1,5 @@ -package com.techyourchance.threadposter; +package com.techyourchance.threadposter.testdoubles; + import org.junit.Before; import org.junit.ClassRule; diff --git a/threadposter/src/test/java/com/techyourchance/threadposter/UiThreadPosterTestDoubleTest.java b/threadposter/src/test/java/com/techyourchance/threadposter/testdoubles/UiThreadPosterTestDoubleTest.java similarity index 94% rename from threadposter/src/test/java/com/techyourchance/threadposter/UiThreadPosterTestDoubleTest.java rename to threadposter/src/test/java/com/techyourchance/threadposter/testdoubles/UiThreadPosterTestDoubleTest.java index bdf9feb..3179280 100755 --- a/threadposter/src/test/java/com/techyourchance/threadposter/UiThreadPosterTestDoubleTest.java +++ b/threadposter/src/test/java/com/techyourchance/threadposter/testdoubles/UiThreadPosterTestDoubleTest.java @@ -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;