8000 Hexagonal pattern: remove unnecessary repository usage from a unit test · mryba/java-design-patterns@3cb8728 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3cb8728

Browse files
committed
Hexagonal pattern: remove unnecessary repository usage from a unit test
1 parent ab68129 commit 3cb8728

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,16 @@
4949
public class LotteryTest {
5050

5151
private final LotterySystem lotterySystem = new LotterySystemImpl();
52-
private final LotteryTicketRepository repository = new LotteryTicketInMemoryRepository();
5352
private final WireTransfers wireTransfers = new WireTransfersImpl();
5453

5554
@Before
5655
public void clear() {
57-
repository.deleteAll();
56+
// add funds to the test player's bank account
57+
wireTransfers.setFunds("123-12312", 100);
5858
}
5959

6060
@Test
6161
public void testLottery() {
62-
63-
// setup bank account with funds
64-
wireTransfers.setFunds("123-12312", 100);
65-
6662
// admin resets the lottery
6763
lotterySystem.resetLottery();
6864
assertEquals(lotterySystem.getAllSubmittedTickets().size(), 0);

0 commit comments

Comments
 (0)
0