diff --git a/src/test/java/seedu/financialplanner/investments/WatchListTest.java b/src/test/java/seedu/financialplanner/investments/WatchListTest.java index 4d29930914..6874a460d8 100644 --- a/src/test/java/seedu/financialplanner/investments/WatchListTest.java +++ b/src/test/java/seedu/financialplanner/investments/WatchListTest.java @@ -1,6 +1,9 @@ package seedu.financialplanner.investments; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; import seedu.financialplanner.exceptions.FinancialPlannerException; import java.util.ArrayList; @@ -8,9 +11,11 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertEquals; +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) class WatchListTest { @Test + @Order(1) void fetchFMPStockPrices() throws FinancialPlannerException { WatchList wl = WatchList.getInstance(); wl.fetchFMPStockPrices(); @@ -20,6 +25,7 @@ void fetchFMPStockPrices() throws FinancialPlannerException { } @Test + @Order(2) void addStock() throws Exception { WatchList wl = WatchList.getInstance(); String stockCode = "GME"; @@ -27,9 +33,10 @@ void addStock() throws Exception { } @Test + @Order(3) void deleteStock() throws FinancialPlannerException { WatchList wl = WatchList.getInstance(); - String stockCode = "AAPL"; - assertEquals("Apple Inc", wl.deleteStock(stockCode)); + String stockCode = "GME"; + assertEquals("Gamestop Corporation - Class A", wl.deleteStock(stockCode)); } }