From 3cb872807eee1173ef4724f51aab10a12e963dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Sun, 4 Sep 2016 10:33:26 +0300 Subject: [PATCH] Hexagonal pattern: remove unnecessary repository usage from a unit test --- .../java/com/iluwatar/hexagonal/domain/LotteryTest.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryTest.java b/hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryTest.java index 59c8c1930..3e114ddc4 100644 --- a/hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryTest.java +++ b/hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryTest.java @@ -49,20 +49,16 @@ import com.iluwatar.hexagonal.test.LotteryTestUtils; public class LotteryTest { private final LotterySystem lotterySystem = new LotterySystemImpl(); - private final LotteryTicketRepository repository = new LotteryTicketInMemoryRepository(); private final WireTransfers wireTransfers = new WireTransfersImpl(); @Before public void clear() { - repository.deleteAll(); + // add funds to the test player's bank account + wireTransfers.setFunds("123-12312", 100); } @Test public void testLottery() { - - // setup bank account with funds - wireTransfers.setFunds("123-12312", 100); - // admin resets the lottery lotterySystem.resetLottery(); assertEquals(lotterySystem.getAllSubmittedTickets().size(), 0);