68 Commits

Author SHA1 Message Date
Paweł Matejko
4446e74338 Hexagonal pattern fixes (#814)
* Fixed wrong else condition

* Simplified creating Set of numbers

* Deleted unused imports

* Replaced 'for' loop with 'foreach' one

* Replaced explicit type with diamond

* Removed unnecesary brackets from lambda

* Removed unnecesary contains check before adding element to Set

* Fixed typo and changed non-english constant names
2018-10-27 16:39:16 +05:30
Narendra Pathai
37ae182630 Resolved PMD issues 2018-10-15 13:30:20 +05:30
Narendra Pathai
ab2c12e734 1) Refactored LotteryNumbers to use Joiner from guava library to join lottery numbers. 2) Solved potential thread safety issue in LotteryTicketId class, where it was using raw primitive value and incrementing it which is not thread-safe. So used AtomicInteger for brevity 3) assertEquals arguments were in incorrect order at many places, so changed order of those 4) Replaced assertFalse and assertTrue at some places with assertEquals and assertNotEquals for reducing complexity of code 5) Removed public modifiers from test cases, as they are no more needed by JUnit 5 2018-10-15 13:21:00 +05:30
Nick Andrievsky
1d12d94bac Fix redundant list alloc in LotteryNumbers 2018-09-11 11:55:53 +02:00
Ilkka Seppälä
16df157181 Add license headers 2018-08-13 08:13:06 +03:00
Agustí Becerra Milà
b453753790 Fix import not used 2018-07-08 19:38:54 +02:00
Agustí Becerra Milà
d2b900b524 Fix checkstyle & update interface services 2018-07-08 19:25:42 +02:00
Agustí Becerra Milà
ae07423470 First proposal 2018-07-01 16:29:07 +02:00
baislsl
991ba320a6 Improve Javadoc 2018-02-19 22:01:14 +08:00
Artur Mogozov
6694d742a3 Migrate to JUnit5 2017-12-31 16:29:48 +09:00
Mudit Porwal
09585c3874 Removed AvoidStarImport Rule
Added JavaDocType Rule
2017-03-22 01:16:02 +08:00
Ilkka Seppälä
9ec0935a1c Merge pull request #532 from leogtzr/master
Adding initialization-on-demand idiom and noninstantiable class instead of interface constant idiom
2017-01-23 08:21:07 +02:00
leogtzr
d6fc28e120 Changing code to use interfaces instead of implementations. 2017-01-21 15:47:54 -07:00
Krisztián Nagy
95f2c19780 Sonar bug fixes using Yoda condition in equals expression when comparing String literal with String object.
Using try-with-resources if we use Scanner to close the underlying stream is a good practice to handle resources.
Minimal refactor.
2016-12-18 16:08:59 +01:00
Krisztián Nagy
120033b58b Sonar bug fixes using Yoda condition in equals expression when comparing String literal with String object.
Using try-with-resources if we use Scanner to close the underlying stream is a good practice to handle resources.
Minimal refactor.
2016-12-18 16:04:13 +01:00
Ilkka Seppälä
faa29f8025 Update license headers 2016-11-27 14:34:20 +02:00
daniel-bryla
e138163c4f #502 Adjusted tests for logger introduction 2016-11-04 11:47:06 +01:00
daniel-bryla
0438811489 #502 Replaced usages of System.out with logger. 2016-10-23 19:59:03 +02:00
Ilkka Seppälä
b030cd4eba Hexagonal pattern: Introduce lottery utils class 2016-09-17 09:20:33 +03:00
Ilkka Seppälä
6aa58e8ae6 Hexagonal pattern: Remove unnecessary factories 2016-09-17 09:07:06 +03:00
Ilkka Seppälä
914d1353a1 Hexagonal pattern: Update test application description 2016-09-15 21:56:15 +03:00
Ilkka Seppälä
df32a7b893 Hexagonal pattern: Introduced lottery events port with two adapters 2016-09-15 21:45:09 +03:00
Ilkka Seppälä
c4c5e78e50 Hexagonal pattern: Improve error handling in console lottery 2016-09-14 22:18:42 +03:00
Ilkka Seppälä
3cf2b34d2a Hexagonal pattern: Improve connection properties handling 2016-09-14 22:01:41 +03:00
Ilkka Seppälä
27e8cb7f2d Hexagonal pattern: Add separate class for Mongo connection properties 2016-09-14 19:25:26 +03:00
Ilkka Seppälä
e685512ed5 Hexagonal pattern: Added Mongo based banking adapter and bound it in Guice production module 2016-09-11 23:19:02 +03:00
Ilkka Seppälä
59e6a0af85 Hexagonal pattern: Ignore Mongo repository test 2016-09-11 22:16:50 +03:00
Ilkka Seppälä
626c56730c Hexagonal pattern: Added Mongo based ticket repository and set production configuration to use that 2016-09-11 20:02:34 +03:00
Ilkka Seppälä
4410419914 Hexagonal pattern: Simplified lottery ticket ids 2016-09-11 10:34:12 +03:00
Ilkka Seppälä
e17d72bca8 Hexagonal pattern: Added console interfaces for players and administration. 2016-09-10 14:28:05 +03:00
Ilkka Seppälä
121ed3cca8 Hexagonal pattern: Move lottery administration and service to the core. Introduce console interfaces for players and administartors. 2016-09-10 07:56:37 +03:00
Ilkka Seppälä
adc6019c7e Hexagonal pattern: Remove interfaces with only one implementation 2016-09-10 07:14:24 +03:00
Ilkka Seppälä
0f2807b9cf Hexagonal pattern: More descriptive class names 2016-09-09 21:36:17 +03:00
Ilkka Seppälä
1b10ddbb73 Hexagonal pattern: Use Guice dependency injection 2016-09-06 22:39:39 +03:00
Ilkka Seppälä
3cb872807e Hexagonal pattern: remove unnecessary repository usage from a unit test 2016-09-04 10:33:26 +03:00
Ilkka Seppälä
ab68129829 Hexagonal pattern: move business logic to core 2016-09-03 22:02:08 +03:00
Ilkka Seppälä
0b36a3153d Fix checkstyle error 2016-08-14 22:42:59 +03:00
Ilkka Seppälä
7c2f5da926 Add final keyword 2016-08-13 18:28:53 +03:00
Ilkka Seppälä
ffbc5f2f29 Reorganize LotteryNumbers for easier inclusion in the blog 2016-08-13 17:08:57 +03:00
Ilkka Seppälä
75ed1b1a96 Review fixes 2016-05-21 21:48:25 +03:00
Ilkka Seppälä
e546d5dacc Add general description for the example code 2016-04-10 21:50:02 +03:00
Ilkka Seppälä
ccc1ec921a Add readme and class diagram 2016-04-10 21:22:40 +03:00
Ilkka Seppälä
5de9c7e6b4 Lots of improvements to the example 2016-04-09 16:53:34 +03:00
Ilkka Seppälä
48803d4c7d Add example lottery run 2016-04-09 16:01:47 +03:00
Ilkka Seppälä
b94a705161 Add constants for win sum and prize payer's bank account 2016-04-09 15:14:12 +03:00
Ilkka Seppälä
6608a8de38 Utilize notifications and banking 2016-03-27 23:35:51 +03:00
Ilkka Seppälä
28d3cb2aa2 Add notifications implementation 2016-03-26 22:01:31 +02:00
Ilkka Seppälä
11c0654103 Add banking implementation 2016-03-26 21:47:25 +02:00
Ilkka Seppälä
f620123cee Organize packages 2016-03-26 21:22:49 +02:00
Ilkka Seppälä
ac468bb7e7 Added high level lottery test 2016-03-26 15:54:40 +02:00