Hexagonal pattern: remove unnecessary repository usage from a unit test
This commit is contained in:
parent
ab68129829
commit
3cb872807e
@ -49,20 +49,16 @@ import com.iluwatar.hexagonal.test.LotteryTestUtils;
|
|||||||
public class LotteryTest {
|
public class LotteryTest {
|
||||||
|
|
||||||
private final LotterySystem lotterySystem = new LotterySystemImpl();
|
private final LotterySystem lotterySystem = new LotterySystemImpl();
|
||||||
private final LotteryTicketRepository repository = new LotteryTicketInMemoryRepository();
|
|
||||||
private final WireTransfers wireTransfers = new WireTransfersImpl();
|
private final WireTransfers wireTransfers = new WireTransfersImpl();
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void clear() {
|
public void clear() {
|
||||||
repository.deleteAll();
|
// add funds to the test player's bank account
|
||||||
|
wireTransfers.setFunds("123-12312", 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLottery() {
|
public void testLottery() {
|
||||||
|
|
||||||
// setup bank account with funds
|
|
||||||
wireTransfers.setFunds("123-12312", 100);
|
|
||||||
|
|
||||||
// admin resets the lottery
|
// admin resets the lottery
|
||||||
lotterySystem.resetLottery();
|
lotterySystem.resetLottery();
|
||||||
assertEquals(lotterySystem.getAllSubmittedTickets().size(), 0);
|
assertEquals(lotterySystem.getAllSubmittedTickets().size(), 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user