Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5de9c7e

Browse filesBrowse files
committed
Lots of improvements to the example
1 parent 48803d4 commit 5de9c7e
Copy full SHA for 5de9c7e

File tree

Expand file treeCollapse file tree

9 files changed

+130
-58
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

9 files changed

+130
-58
lines changed
Open diff view settings
Collapse file

‎hexagonal/src/main/java/com/iluwatar/hexagonal/App.java‎

Copy file name to clipboardExpand all lines: hexagonal/src/main/java/com/iluwatar/hexagonal/App.java
+47-41Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
import com.iluwatar.hexagonal.administration.LotteryAdministration;
3030
import com.iluwatar.hexagonal.administration.LotteryAdministrationImpl;
31+
import com.iluwatar.hexagonal.banking.WireTransfersImpl;
32+
import com.iluwatar.hexagonal.domain.LotteryConstants;
3133
import com.iluwatar.hexagonal.domain.LotteryNumbers;
3234
import com.iluwatar.hexagonal.domain.LotteryTicket;
3335
import com.iluwatar.hexagonal.domain.PlayerDetails;
@@ -46,44 +48,50 @@ public class App {
4648
static {
4749
allPlayerDetails = new ArrayList<>();
4850
allPlayerDetails.add(PlayerDetails.create("john@google.com", "312-342", "+3242434242"));
49-
allPlayerDetails.add(PlayerDetails.create("mary@google.com", "312-342", "+3242434242"));
50-
allPlayerDetails.add(PlayerDetails.create("steve@google.com", "312-342", "+3242434242"));
51-
allPlayerDetails.add(PlayerDetails.create("wayne@google.com", "312-342", "+3242434242"));
52-
allPlayerDetails.add(PlayerDetails.create("johnie@google.com", "312-342", "+3242434242"));
53-
allPlayerDetails.add(PlayerDetails.create("andy@google.com", "312-342", "+3242434242"));
54-
allPlayerDetails.add(PlayerDetails.create("richard@google.com", "312-342", "+3242434242"));
55-
allPlayerDetails.add(PlayerDetails.create("kevin@google.com", "312-342", "+3242434242"));
56-
allPlayerDetails.add(PlayerDetails.create("arnold@google.com", "312-342", "+3242434242"));
57-
allPlayerDetails.add(PlayerDetails.create("ian@google.com", "312-342", "+3242434242"));
58-
allPlayerDetails.add(PlayerDetails.create("robin@google.com", "312-342", "+3242434242"));
59-
allPlayerDetails.add(PlayerDetails.create("ted@google.com", "312-342", "+3242434242"));
60-
allPlayerDetails.add(PlayerDetails.create("larry@google.com", "312-342", "+3242434242"));
61-
allPlayerDetails.add(PlayerDetails.create("calvin@google.com", "312-342", "+3242434242"));
62-
allPlayerDetails.add(PlayerDetails.create("jacob@google.com", "312-342", "+3242434242"));
63-
allPlayerDetails.add(PlayerDetails.create("edwin@google.com", "312-342", "+3242434242"));
64-
allPlayerDetails.add(PlayerDetails.create("mary@google.com", "312-342", "+3242434242"));
65-
allPlayerDetails.add(PlayerDetails.create("lolita@google.com", "312-342", "+3242434242"));
66-
allPlayerDetails.add(PlayerDetails.create("bruno@google.com", "312-342", "+3242434242"));
67-
allPlayerDetails.add(PlayerDetails.create("peter@google.com", "312-342", "+3242434242"));
68-
allPlayerDetails.add(PlayerDetails.create("warren@google.com", "312-342", "+3242434242"));
69-
allPlayerDetails.add(PlayerDetails.create("monica@google.com", "312-342", "+3242434242"));
70-
allPlayerDetails.add(PlayerDetails.create("ollie@google.com", "312-342", "+3242434242"));
71-
allPlayerDetails.add(PlayerDetails.create("yngwie@google.com", "312-342", "+3242434242"));
72-
allPlayerDetails.add(PlayerDetails.create("lars@google.com", "312-342", "+3242434242"));
73-
allPlayerDetails.add(PlayerDetails.create("bobbie@google.com", "312-342", "+3242434242"));
74-
allPlayerDetails.add(PlayerDetails.create("tyron@google.com", "312-342", "+3242434242"));
75-
allPlayerDetails.add(PlayerDetails.create("tyrell@google.com", "312-342", "+3242434242"));
76-
allPlayerDetails.add(PlayerDetails.create("nadja@google.com", "312-342", "+3242434242"));
77-
allPlayerDetails.add(PlayerDetails.create("wendy@google.com", "312-342", "+3242434242"));
78-
allPlayerDetails.add(PlayerDetails.create("luke@google.com", "312-342", "+3242434242"));
79-
allPlayerDetails.add(PlayerDetails.create("bjorn@google.com", "312-342", "+3242434242"));
80-
allPlayerDetails.add(PlayerDetails.create("lisa@google.com", "312-342", "+3242434242"));
81-
allPlayerDetails.add(PlayerDetails.create("anton@google.com", "312-342", "+3242434242"));
82-
allPlayerDetails.add(PlayerDetails.create("bruce@google.com", "312-342", "+3242434242"));
83-
allPlayerDetails.add(PlayerDetails.create("ray@google.com", "312-342", "+3242434242"));
84-
allPlayerDetails.add(PlayerDetails.create("ron@google.com", "312-342", "+3242434242"));
85-
allPlayerDetails.add(PlayerDetails.create("xavier@google.com", "312-342", "+3242434242"));
86-
allPlayerDetails.add(PlayerDetails.create("harriet@google.com", "312-342", "+3242434242"));
51+
allPlayerDetails.add(PlayerDetails.create("mary@google.com", "234-987", "+23452346"));
52+
allPlayerDetails.add(PlayerDetails.create("steve@google.com", "833-836", "+63457543"));
53+
allPlayerDetails.add(PlayerDetails.create("wayne@google.com", "319-826", "+24626"));
54+
allPlayerDetails.add(PlayerDetails.create("johnie@google.com", "983-322", "+3635635"));
55+
allPlayerDetails.add(PlayerDetails.create("andy@google.com", "934-734", "+0898245"));
56+
allPlayerDetails.add(PlayerDetails.create("richard@google.com", "536-738", "+09845325"));
57+
allPlayerDetails.add(PlayerDetails.create("kevin@google.com", "453-936", "+2423532"));
58+
allPlayerDetails.add(PlayerDetails.create("arnold@google.com", "114-988", "+5646346524"));
59+
allPlayerDetails.add(PlayerDetails.create("ian@google.com", "663-765", "+928394235"));
60+
allPlayerDetails.add(PlayerDetails.create("robin@google.com", "334-763", "+35448"));
61+
allPlayerDetails.add(PlayerDetails.create("ted@google.com", "735-964", "+98752345"));
62+
allPlayerDetails.add(PlayerDetails.create("larry@google.com", "734-853", "+043842423"));
63+
allPlayerDetails.add(PlayerDetails.create("calvin@google.com", "334-746", "+73294135"));
64+
allPlayerDetails.add(PlayerDetails.create("jacob@google.com", "444-766", "+358042354"));
65+
allPlayerDetails.add(PlayerDetails.create("edwin@google.com", "895-345", "+9752435"));
66+
allPlayerDetails.add(PlayerDetails.create("mary@google.com", "760-009", "+34203542"));
67+
allPlayerDetails.add(PlayerDetails.create("lolita@google.com", "425-907", "+9872342"));
68+
allPlayerDetails.add(PlayerDetails.create("bruno@google.com", "023-638", "+673824122"));
69+
allPlayerDetails.add(PlayerDetails.create("peter@google.com", "335-886", "+5432503945"));
70+
allPlayerDetails.add(PlayerDetails.create("warren@google.com", "225-946", "+9872341324"));
71+
allPlayerDetails.add(PlayerDetails.create("monica@google.com", "265-748", "+134124"));
72+
allPlayerDetails.add(PlayerDetails.create("ollie@google.com", "190-045", "+34453452"));
73+
allPlayerDetails.add(PlayerDetails.create("yngwie@google.com", "241-465", "+9897641231"));
74+
allPlayerDetails.add(PlayerDetails.create("lars@google.com", "746-936", "+42345298345"));
75+
allPlayerDetails.add(PlayerDetails.create("bobbie@google.com", "946-384", "+79831742"));
76+
allPlayerDetails.add(PlayerDetails.create("tyron@google.com", "310-992", "+0498837412"));
77+
allPlayerDetails.add(PlayerDetails.create("tyrell@google.com", "032-045", "+67834134"));
78+
allPlayerDetails.add(PlayerDetails.create("nadja@google.com", "000-346", "+498723"));
79+
allPlayerDetails.add(PlayerDetails.create("wendy@google.com", "994-989", "+987324454"));
80+
allPlayerDetails.add(PlayerDetails.create("luke@google.com", "546-634", "+987642435"));
81+
allPlayerDetails.add(PlayerDetails.create("bjorn@google.com", "342-874", "+7834325"));
82+
allPlayerDetails.add(PlayerDetails.create("lisa@google.com", "024-653", "+980742154"));
83+
allPlayerDetails.add(PlayerDetails.create("anton@google.com", "834-935", "+876423145"));
84+
allPlayerDetails.add(PlayerDetails.create("bruce@google.com", "284-936", "+09843212345"));
85+
allPlayerDetails.add(PlayerDetails.create("ray@google.com", "843-073", "+678324123"));
86+
allPlayerDetails.add(PlayerDetails.create("ron@google.com", "637-738", "+09842354"));
87+
allPlayerDetails.add(PlayerDetails.create("xavier@google.com", "143-947", "+375245"));
88+
allPlayerDetails.add(PlayerDetails.create("harriet@google.com", "842-404", "+131243252"));
89+
WireTransfersImpl wireTransfers = new WireTransfersImpl();
90+
Random random = new Random();
91+
for (int i = 0; i < allPlayerDetails.size(); i++) {
92+
wireTransfers.setFunds(allPlayerDetails.get(i).getBankAccount(),
93+
random.nextInt(LotteryConstants.PLAYER_MAX_SALDO));
94+
}
8795
}
8896

8997
/**
@@ -98,14 +106,12 @@ public static void main(String[] args) {
98106
LotteryServiceImpl service = new LotteryServiceImpl();
99107
submitTickets(service, 20);
100108

101-
int i = administartion.getAllSubmittedTickets().size();
102-
103109
// perform lottery
104110
administartion.performLottery();
105111
}
106112

107113
private static void submitTickets(LotteryService lotteryService, int numTickets) {
108-
for (int i=0; i<numTickets; i++) {
114+
for (int i = 0; i < numTickets; i++) {
109115
LotteryTicket ticket = LotteryTicket.create(getRandomPlayerDetails(), LotteryNumbers.createRandom());
110116
lotteryService.submitTicket(ticket);
111117
}
Collapse file

‎hexagonal/src/main/java/com/iluwatar/hexagonal/administration/LotteryAdministrationImpl.java‎

Copy file name to clipboardExpand all lines: hexagonal/src/main/java/com/iluwatar/hexagonal/administration/LotteryAdministrationImpl.java
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.iluwatar.hexagonal.banking.WireTransfersImpl;
2929
import com.iluwatar.hexagonal.database.LotteryTicketRepository;
3030
import com.iluwatar.hexagonal.database.LotteryTicketRepositoryMock;
31+
import com.iluwatar.hexagonal.domain.LotteryConstants;
3132
import com.iluwatar.hexagonal.domain.LotteryNumbers;
3233
import com.iluwatar.hexagonal.domain.LotteryTicket;
3334
import com.iluwatar.hexagonal.domain.LotteryTicketCheckResult;
@@ -45,10 +46,6 @@
4546
*/
4647
public class LotteryAdministrationImpl implements LotteryAdministration {
4748

48-
private static final int WIN_AMOUNT = 100000;
49-
50-
private static final String PRIZE_PAYER_BANK_ACCOUNT = "123-123";
51-
5249
private final LotteryTicketRepository repository;
5350

5451
private final LotteryService service = new LotteryServiceImpl();
@@ -73,8 +70,13 @@ public LotteryNumbers performLottery() {
7370
for (LotteryTicketId id: tickets.keySet()) {
7471
LotteryTicketCheckResult result = service.checkTicketForPrize(id, numbers);
7572
if (result.getResult().equals(CheckResult.WIN_PRIZE)) {
76-
bank.transferFunds(WIN_AMOUNT, PRIZE_PAYER_BANK_ACCOUNT, tickets.get(id).getPlayerDetails().getBankAccount());
77-
notifications.notifyPrize(tickets.get(id).getPlayerDetails(), WIN_AMOUNT);
73+
boolean transferred = bank.transferFunds(LotteryConstants.PRIZE_AMOUNT, LotteryConstants.SERVICE_BANK_ACCOUNT,
74+
tickets.get(id).getPlayerDetails().getBankAccount());
75+
if (transferred) {
76+
notifications.notifyPrize(tickets.get(id).getPlayerDetails(), LotteryConstants.PRIZE_AMOUNT);
77+
} else {
78+
notifications.notifyPrizeError(tickets.get(id).getPlayerDetails(), LotteryConstants.PRIZE_AMOUNT);
79+
}
7880
} else if (result.getResult().equals(CheckResult.NO_PRIZE)) {
7981
notifications.notifyNoWin(tickets.get(id).getPlayerDetails());
8082
}
Collapse file

‎hexagonal/src/main/java/com/iluwatar/hexagonal/banking/WireTransfersImpl.java‎

Copy file name to clipboardExpand all lines: hexagonal/src/main/java/com/iluwatar/hexagonal/banking/WireTransfersImpl.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import java.util.HashMap;
2626
import java.util.Map;
2727

28+
import com.iluwatar.hexagonal.domain.LotteryConstants;
29+
2830
/**
2931
*
3032
* Banking implementation
@@ -35,7 +37,7 @@ public class WireTransfersImpl implements WireTransfers {
3537
private static Map<String, Integer> accounts = new HashMap<>();
3638

3739
static {
38-
accounts.put("123-123", 50000);
40+
accounts.put(LotteryConstants.SERVICE_BANK_ACCOUNT, LotteryConstants.SERVICE_BANK_ACCOUNT_SALDO);
3941
}
4042

4143
@Override
Collapse file
+38Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* The MIT License
3+
* Copyright (c) 2014 Ilkka Seppälä
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy
6+
* of this software and associated documentation files (the "Software"), to deal
7+
* in the Software without restriction, including without limitation the rights
8+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
* copies of the Software, and to permit persons to whom the Software is
10+
* furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in
13+
* all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
* THE SOFTWARE.
22+
*/
23+
package com.iluwatar.hexagonal.domain;
24+
25+
/**
26+
*
27+
* Lottery domain constants
28+
*
29+
*/
30+
public class LotteryConstants {
31+
32+
public static final int PRIZE_AMOUNT = 100000;
33+
public static final String SERVICE_BANK_ACCOUNT = "123-123";
34+
public static final int TICKET_PRIZE = 3;
35+
public static final int SERVICE_BANK_ACCOUNT_SALDO = 150000;
36+
public static final int PLAYER_MAX_SALDO = 100;
37+
38+
}
Collapse file

‎hexagonal/src/main/java/com/iluwatar/hexagonal/domain/LotteryTicketCheckResult.java‎

Copy file name to clipboardExpand all lines: hexagonal/src/main/java/com/iluwatar/hexagonal/domain/LotteryTicketCheckResult.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
public class LotteryTicketCheckResult {
3131

32-
public enum CheckResult {WIN_PRIZE, NO_PRIZE, TICKET_NOT_SUBMITTED};
32+
public enum CheckResult { WIN_PRIZE, NO_PRIZE, TICKET_NOT_SUBMITTED };
3333

3434
private final CheckResult checkResult;
3535

Collapse file

‎hexagonal/src/main/java/com/iluwatar/hexagonal/notifications/LotteryNotifications.java‎

Copy file name to clipboardExpand all lines: hexagonal/src/main/java/com/iluwatar/hexagonal/notifications/LotteryNotifications.java
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
public interface LotteryNotifications {
3333

3434
void notifyTicketSubmitted(PlayerDetails details);
35+
void notifyTicketSubmitError(PlayerDetails details);
3536
void notifyNoWin(PlayerDetails details);
3637
void notifyPrize(PlayerDetails details, int prizeAmount);
38+
void notifyPrizeError(PlayerDetails details, int prizeAmount);
3739

3840
}
Collapse file

‎hexagonal/src/main/java/com/iluwatar/hexagonal/notifications/LotteryNotificationsImpl.java‎

Copy file name to clipboardExpand all lines: hexagonal/src/main/java/com/iluwatar/hexagonal/notifications/LotteryNotificationsImpl.java
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,18 @@ public void notifyPrize(PlayerDetails details, int prizeAmount) {
4444
.println(String.format("Lottery ticket for %s has won! The bank account %s was deposited with %d credits.",
4545
details.getEmail(), details.getBankAccount(), prizeAmount));
4646
}
47+
48+
@Override
49+
public void notifyPrizeError(PlayerDetails details, int prizeAmount) {
50+
System.out
51+
.println(String.format("Lottery ticket for %s has won! Unfortunately the bank credit transfer of %d failed.",
52+
details.getEmail(), prizeAmount));
53+
}
54+
55+
@Override
56+
public void notifyTicketSubmitError(PlayerDetails details) {
57+
System.out.println(
58+
String.format("Lottery ticket for %s could not be submitted because the credit transfer of 3 credits failed.",
59+
details.getEmail()));
60+
}
4761
}
Collapse file

‎hexagonal/src/main/java/com/iluwatar/hexagonal/service/LotteryServiceImpl.java‎

Copy file name to clipboardExpand all lines: hexagonal/src/main/java/com/iluwatar/hexagonal/service/LotteryServiceImpl.java
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.iluwatar.hexagonal.banking.WireTransfersImpl;
2929
import com.iluwatar.hexagonal.database.LotteryTicketRepository;
3030
import com.iluwatar.hexagonal.database.LotteryTicketRepositoryMock;
31+
import com.iluwatar.hexagonal.domain.LotteryConstants;
3132
import com.iluwatar.hexagonal.domain.LotteryNumbers;
3233
import com.iluwatar.hexagonal.domain.LotteryTicket;
3334
import com.iluwatar.hexagonal.domain.LotteryTicketCheckResult;
@@ -43,10 +44,6 @@
4344
*/
4445
public class LotteryServiceImpl implements LotteryService {
4546

46-
private static final String LOTTERY_SERVICE_BANK_ACCOUNT = "123-123";
47-
48-
private static final int TICKET_PRIZE = 3;
49-
5047
private final LotteryTicketRepository repository;
5148

5249
private final WireTransfers bank = new WireTransfersImpl();
@@ -59,7 +56,12 @@ public LotteryServiceImpl() {
5956

6057
@Override
6158
public Optional<LotteryTicketId> submitTicket(LotteryTicket ticket) {
62-
bank.transferFunds(TICKET_PRIZE, ticket.getPlayerDetails().getBankAccount(), LOTTERY_SERVICE_BANK_ACCOUNT);
59+
boolean result = bank.transferFunds(LotteryConstants.TICKET_PRIZE, ticket.getPlayerDetails().getBankAccount(),
60+
LotteryConstants.SERVICE_BANK_ACCOUNT);
61+
if (result == false) {
62+
notifications.notifyTicketSubmitError(ticket.getPlayerDetails());
63+
return Optional.empty();
64+
}
6365
Optional<LotteryTicketId> optional = repository.save(ticket);
6466
if (optional.isPresent()) {
6567
notifications.notifyTicketSubmitted(ticket.getPlayerDetails());
Collapse file

‎hexagonal/src/test/java/com/iluwatar/hexagonal/lottery/LotteryTest.java‎

Copy file name to clipboardExpand all lines: hexagonal/src/test/java/com/iluwatar/hexagonal/lottery/LotteryTest.java
+10-4Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@
3535

3636
import com.iluwatar.hexagonal.administration.LotteryAdministration;
3737
import com.iluwatar.hexagonal.administration.LotteryAdministrationImpl;
38+
import com.iluwatar.hexagonal.banking.WireTransfers;
39+
import com.iluwatar.hexagonal.banking.WireTransfersImpl;
3840
import com.iluwatar.hexagonal.database.LotteryTicketRepository;
3941
import com.iluwatar.hexagonal.database.LotteryTicketRepositoryMock;
4042
import com.iluwatar.hexagonal.domain.LotteryNumbers;
4143
import com.iluwatar.hexagonal.domain.LotteryTicket;
4244
import com.iluwatar.hexagonal.domain.LotteryTicketCheckResult;
43-
import com.iluwatar.hexagonal.domain.LotteryTicketId;
4445
import com.iluwatar.hexagonal.domain.LotteryTicketCheckResult.CheckResult;
46+
import com.iluwatar.hexagonal.domain.LotteryTicketId;
4547
import com.iluwatar.hexagonal.service.LotteryService;
4648
import com.iluwatar.hexagonal.service.LotteryServiceImpl;
4749
import com.iluwatar.hexagonal.test.LotteryTestUtils;
@@ -56,6 +58,7 @@ public class LotteryTest {
5658
private final LotteryAdministration admin = new LotteryAdministrationImpl();
5759
private final LotteryService service = new LotteryServiceImpl();
5860
private final LotteryTicketRepository repository = new LotteryTicketRepositoryMock();
61+
private final WireTransfers wireTransfers = new WireTransfersImpl();
5962

6063
@Before
6164
public void clear() {
@@ -65,6 +68,9 @@ public void clear() {
6568
@Test
6669
public void testLottery() {
6770

71+
// setup bank account with funds
72+
wireTransfers.setFunds("123-12312", 100);
73+
6874
// admin resets the lottery
6975
admin.resetLottery();
7076
assertEquals(admin.getAllSubmittedTickets().size(), 0);
@@ -74,10 +80,10 @@ public void testLottery() {
7480
"123-12312", "+32425255", new HashSet<>(Arrays.asList(1, 2, 3, 4))));
7581
assertTrue(ticket1.isPresent());
7682
Optional<LotteryTicketId> ticket2 = service.submitTicket(LotteryTestUtils.createLotteryTicket("ant@bac.com",
77-
"123-12345", "+32423455", new HashSet<>(Arrays.asList(11, 12, 13, 14))));
83+
"123-12312", "+32423455", new HashSet<>(Arrays.asList(11, 12, 13, 14))));
7884
assertTrue(ticket2.isPresent());
7985
Optional<LotteryTicketId> ticket3 = service.submitTicket(LotteryTestUtils.createLotteryTicket("arg@boo.com",
80-
"123-12367", "+32421255", new HashSet<>(Arrays.asList(6, 8, 13, 19))));
86+
"123-12312", "+32421255", new HashSet<>(Arrays.asList(6, 8, 13, 19))));
8187
assertTrue(ticket3.isPresent());
8288
assertEquals(admin.getAllSubmittedTickets().size(), 3);
8389

@@ -86,7 +92,7 @@ public void testLottery() {
8692

8793
// cheat a bit for testing sake, use winning numbers to submit another ticket
8894
Optional<LotteryTicketId> ticket4 = service.submitTicket(LotteryTestUtils.createLotteryTicket("lucky@orb.com",
89-
"123-12399", "+12421255", winningNumbers.getNumbers()));
95+
"123-12312", "+12421255", winningNumbers.getNumbers()));
9096
assertTrue(ticket4.isPresent());
9197
assertEquals(admin.getAllSubmittedTickets().size(), 4);
9298

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.