diff options
author | Aleksandr <ognelisar@gmail.com> | 2017-09-28 14:32:21 +0700 |
---|---|---|
committer | Aleksandr <ognelisar@gmail.com> | 2017-09-28 14:32:21 +0700 |
commit | 1f569ac1a31f88334c25976d94e7c495a7bbde80 (patch) | |
tree | 584162d344db1ea767adb72dc6a67164a1e89e68 /src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/BridgeUploadQueueGen.scala | |
parent | d8e71e0a9ee7db58032384d059403bc227a35138 (diff) | |
download | rest-query-1f569ac1a31f88334c25976d94e7c495a7bbde80.tar.gz rest-query-1f569ac1a31f88334c25976d94e7c495a7bbde80.tar.bz2 rest-query-1f569ac1a31f88334c25976d94e7c495a7bbde80.zip |
Implemented all generator for REP's entities
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/BridgeUploadQueueGen.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/BridgeUploadQueueGen.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/BridgeUploadQueueGen.scala b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/BridgeUploadQueueGen.scala new file mode 100644 index 0000000..fb1d3e3 --- /dev/null +++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/BridgeUploadQueueGen.scala @@ -0,0 +1,31 @@ +package xyz.driver.pdsuidomain.fakes.entities.rep + +import xyz.driver.core.generators.{nextBoolean, nextInt, nextOption, nextString} +import xyz.driver.pdsuicommon.concurrent.BridgeUploadQueue +import xyz.driver.pdsuidomain.entities.ProviderType +import xyz.driver.pdsuidomain.fakes.entities.common.{nextLocalDateTime, nextLongId} + +object BridgeUploadQueueGen { + private val maxAttemtsNumber = 100 + + def nextBridgeUploadQueueItem(): BridgeUploadQueue.Item = { + BridgeUploadQueue.Item( + kind = nextString(), + tag = nextString(), + created = nextLocalDateTime, + attempts = nextInt(maxAttemtsNumber, minValue = 0), + nextAttempt = nextLocalDateTime, + completed = nextBoolean(), + dependencyKind = nextOption(nextString()), + dependencyTag = nextOption(nextString()) + ) + } + + def nextProviderType(): ProviderType = { + ProviderType( + id = nextLongId[ProviderType], + name = nextString() + ) + } + +} |