Organize packages
This commit is contained in:
parent
ac468bb7e7
commit
f620123cee
@ -20,10 +20,14 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.administration;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.iluwatar.hexagonal.domain.LotteryNumbers;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicket;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketId;
|
||||
|
||||
/**
|
||||
*
|
||||
* Administrator interface for lottery service.
|
@ -20,11 +20,15 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.administration;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.iluwatar.hexagonal.adapter.LotteryTicketRepositoryMock;
|
||||
import com.iluwatar.hexagonal.database.LotteryTicketRepository;
|
||||
import com.iluwatar.hexagonal.database.LotteryTicketRepositoryMock;
|
||||
import com.iluwatar.hexagonal.domain.LotteryNumbers;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicket;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketId;
|
||||
|
||||
/**
|
||||
*
|
@ -20,7 +20,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.banking;
|
||||
|
||||
/**
|
||||
*
|
@ -20,11 +20,14 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.database;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicket;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketId;
|
||||
|
||||
/**
|
||||
*
|
||||
* Interface for accessing lottery tickets in database.
|
@ -20,7 +20,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.adapter;
|
||||
package com.iluwatar.hexagonal.database;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -28,7 +28,6 @@ import java.util.Optional;
|
||||
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicket;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketId;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketRepository;
|
||||
|
||||
/**
|
||||
*
|
@ -20,7 +20,9 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.notifications;
|
||||
|
||||
import com.iluwatar.hexagonal.domain.PlayerDetails;
|
||||
|
||||
/**
|
||||
*
|
@ -20,10 +20,15 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import com.iluwatar.hexagonal.domain.LotteryNumbers;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicket;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketCheckResult;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketId;
|
||||
|
||||
/**
|
||||
*
|
||||
* Interface for submitting and checking lottery tickets.
|
@ -20,11 +20,16 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import com.iluwatar.hexagonal.adapter.LotteryTicketRepositoryMock;
|
||||
import com.iluwatar.hexagonal.database.LotteryTicketRepository;
|
||||
import com.iluwatar.hexagonal.database.LotteryTicketRepositoryMock;
|
||||
import com.iluwatar.hexagonal.domain.LotteryNumbers;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicket;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketCheckResult;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketId;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketCheckResult.CheckResult;
|
||||
|
||||
/**
|
@ -20,7 +20,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.database;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@ -30,7 +30,11 @@ import java.util.Optional;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.iluwatar.hexagonal.adapter.LotteryTicketRepositoryMock;
|
||||
import com.iluwatar.hexagonal.database.LotteryTicketRepository;
|
||||
import com.iluwatar.hexagonal.database.LotteryTicketRepositoryMock;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicket;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketId;
|
||||
import com.iluwatar.hexagonal.test.LotteryTestUtils;
|
||||
|
||||
/**
|
||||
*
|
@ -1,61 +0,0 @@
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2014 Ilkka Seppälä
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.iluwatar.hexagonal.adapter.LotteryTicketRepositoryMock;
|
||||
|
||||
/**
|
||||
*
|
||||
* Tests for lottery administration
|
||||
*
|
||||
*/
|
||||
public class LotteryAdministrationTest {
|
||||
|
||||
private LotteryTicketRepository repository = new LotteryTicketRepositoryMock();
|
||||
private LotteryAdministration admin = new LotteryAdministrationImpl();
|
||||
|
||||
@Before
|
||||
public void submitTickets() {
|
||||
repository.deleteAll();
|
||||
repository.save(LotteryTestUtils.createLotteryTicket());
|
||||
repository.save(LotteryTestUtils.createLotteryTicket());
|
||||
repository.save(LotteryTestUtils.createLotteryTicket());
|
||||
repository.save(LotteryTestUtils.createLotteryTicket());
|
||||
repository.save(LotteryTestUtils.createLotteryTicket());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAllTickets() {
|
||||
assertEquals(admin.getAllSubmittedTickets().size(), 5);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPerformLottery() {
|
||||
assertEquals(admin.performLottery().getNumbers().size(), 4);
|
||||
}
|
||||
}
|
@ -20,7 +20,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.lottery;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@ -33,8 +33,18 @@ import java.util.Optional;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.iluwatar.hexagonal.adapter.LotteryTicketRepositoryMock;
|
||||
import com.iluwatar.hexagonal.administration.LotteryAdministration;
|
||||
import com.iluwatar.hexagonal.administration.LotteryAdministrationImpl;
|
||||
import com.iluwatar.hexagonal.database.LotteryTicketRepository;
|
||||
import com.iluwatar.hexagonal.database.LotteryTicketRepositoryMock;
|
||||
import com.iluwatar.hexagonal.domain.LotteryNumbers;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicket;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketCheckResult;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketId;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicketCheckResult.CheckResult;
|
||||
import com.iluwatar.hexagonal.service.LotteryService;
|
||||
import com.iluwatar.hexagonal.service.LotteryServiceImpl;
|
||||
import com.iluwatar.hexagonal.test.LotteryTestUtils;
|
||||
|
||||
/**
|
||||
*
|
@ -20,12 +20,16 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package com.iluwatar.hexagonal.domain;
|
||||
package com.iluwatar.hexagonal.test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.iluwatar.hexagonal.domain.LotteryNumbers;
|
||||
import com.iluwatar.hexagonal.domain.LotteryTicket;
|
||||
import com.iluwatar.hexagonal.domain.PlayerDetails;
|
||||
|
||||
/**
|
||||
*
|
||||
* Utilities for lottery tests
|
Loading…
x
Reference in New Issue
Block a user