diff options
author | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-09-28 17:52:21 +0700 |
---|---|---|
committer | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-09-28 17:52:21 +0700 |
commit | 283ca02360949143ffe7ee8ad87d51902426b450 (patch) | |
tree | c098efe0628fc80a0a6b8f05fa465a99ff494fb8 /src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala | |
parent | d82c93fef0fc0bb937220334f73c264fbb1082f2 (diff) | |
parent | c24679f1ae7d7ccc4e6693535b0aa3ac0e1ca225 (diff) | |
download | rest-query-283ca02360949143ffe7ee8ad87d51902426b450.tar.gz rest-query-283ca02360949143ffe7ee8ad87d51902426b450.tar.bz2 rest-query-283ca02360949143ffe7ee8ad87d51902426b450.zip |
Merge branch 'master' into synch-refactor
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala index 52d7b98..b259b07 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/common.scala @@ -4,6 +4,7 @@ import java.time.{LocalDate, LocalDateTime, LocalTime} import xyz.driver.pdsuicommon.domain.{LongId, StringId, UuidId} import xyz.driver.pdsuidomain.entities.{Trial, TrialHistory} +import scala.util.Random object common { import xyz.driver.core.generators @@ -20,10 +21,11 @@ object common { def nextLocalDateTime = LocalDateTime.of(nextLocalDate, LocalTime.MIDNIGHT) - def nextLocalDate = { - val date = generators.nextDate() - LocalDate.of(date.year, date.month + 1, date.day + 1) - } + def nextLocalDate = LocalDate.of( + 1970 + Random.nextInt(68), + 1 + Random.nextInt(12), + 1 + Random.nextInt(28) // all months have at least 28 days + ) def nextCondition = generators.oneOf[Trial.Condition](Trial.Condition.All) |