diff --git a/test_driven_development/src/main/java/com/techyourchance/testdrivendevelopment/exercise8/networking/GetContactsHttpEndpoint.java b/test_driven_development/src/main/java/com/techyourchance/testdrivendevelopment/exercise8/networking/GetContactsHttpEndpoint.java index ec5c2ae5..4107882c 100755 --- a/test_driven_development/src/main/java/com/techyourchance/testdrivendevelopment/exercise8/networking/GetContactsHttpEndpoint.java +++ b/test_driven_development/src/main/java/com/techyourchance/testdrivendevelopment/exercise8/networking/GetContactsHttpEndpoint.java @@ -10,7 +10,7 @@ enum FailReason { } interface Callback { - void onGetContactsSucceeded(List cartItems); + void onGetContactsSucceeded(List contactSchemas); void onGetContactsFailed(FailReason failReason); } diff --git a/test_driven_development/src/test/java/com/techyourchance/testdrivendevelopment/example11/FetchCartItemsManualTestDoublesUseCaseTest.java b/test_driven_development/src/test/java/com/techyourchance/testdrivendevelopment/example11/FetchCartItemsManualTestDoublesUseCaseTest.java index c7a90f26..13fd8a27 100755 --- a/test_driven_development/src/test/java/com/techyourchance/testdrivendevelopment/example11/FetchCartItemsManualTestDoublesUseCaseTest.java +++ b/test_driven_development/src/test/java/com/techyourchance/testdrivendevelopment/example11/FetchCartItemsManualTestDoublesUseCaseTest.java @@ -49,12 +49,6 @@ public void setup() throws Exception { success(); } - private List getCartItemSchemes() { - List schemas = new ArrayList<>(); - schemas.add(new CartItemSchema(ID, TITLE, DESCRIPTION, PRICE)); - return schemas; - } - @Test public void fetchCartItems_correctLimitPassedToEndpoint() throws Exception { // Arrange @@ -129,6 +123,12 @@ private List getCartItems() { return cartItems; } + private List getCartItemSchemes() { + List schemas = new ArrayList<>(); + schemas.add(new CartItemSchema(ID, TITLE, DESCRIPTION, PRICE)); + return schemas; + } + private void success() { // no-op } diff --git a/test_driven_development/src/test/java/com/techyourchance/testdrivendevelopment/example11/FetchCartItemsUseCaseTest.java b/test_driven_development/src/test/java/com/techyourchance/testdrivendevelopment/example11/FetchCartItemsUseCaseTest.java index 021ec03b..758bf9ff 100755 --- a/test_driven_development/src/test/java/com/techyourchance/testdrivendevelopment/example11/FetchCartItemsUseCaseTest.java +++ b/test_driven_development/src/test/java/com/techyourchance/testdrivendevelopment/example11/FetchCartItemsUseCaseTest.java @@ -16,17 +16,12 @@ import org.mockito.stubbing.Answer; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -58,12 +53,6 @@ public void setup() throws Exception { success(); } - private List getCartItemSchemes() { - List schemas = new ArrayList<>(); - schemas.add(new CartItemSchema(ID, TITLE, DESCRIPTION, PRICE)); - return schemas; - } - @Test public void fetchCartItems_correctLimitPassedToEndpoint() throws Exception { // Arrange @@ -139,6 +128,12 @@ private List getCartItems() { return cartItems; } + private List getCartItemSchemes() { + List schemas = new ArrayList<>(); + schemas.add(new CartItemSchema(ID, TITLE, DESCRIPTION, PRICE)); + return schemas; + } + private void success() { doAnswer(new Answer() { @Override