diff options
author | Vlad Uspensky <v.uspenskiy@icloud.com> | 2017-09-29 12:42:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-29 12:42:35 -0700 |
commit | 46b354b6a49c0843fefc5794f2351f52b98102bd (patch) | |
tree | 20e9a10e87f0859c5c0342f3eee45d04aa214c64 /src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/BridgeUploadQueueGen.scala | |
parent | deba20326e3269fee3ef51f8e6841f17453b4155 (diff) | |
parent | 642f98c2ddd8af6c83d3de5a51c643ba93b23f96 (diff) | |
download | rest-query-46b354b6a49c0843fefc5794f2351f52b98102bd.tar.gz rest-query-46b354b6a49c0843fefc5794f2351f52b98102bd.tar.bz2 rest-query-46b354b6a49c0843fefc5794f2351f52b98102bd.zip |
Merge pull request #32 from drivergroup/PDSUI-rep-fixtures
Implemented generators of entities for ReP; Implemented json objects for swagger model
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 | 22 |
1 files changed, 22 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..e7cbd19 --- /dev/null +++ b/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/BridgeUploadQueueGen.scala @@ -0,0 +1,22 @@ +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.fakes.entities.common.nextLocalDateTime + +object BridgeUploadQueueGen { + private val maxAttemptsNumber = 100 + + def nextBridgeUploadQueueItem(): BridgeUploadQueue.Item = { + BridgeUploadQueue.Item( + kind = nextString(), + tag = nextString(), + created = nextLocalDateTime, + attempts = nextInt(maxAttemptsNumber, minValue = 0), + nextAttempt = nextLocalDateTime, + completed = nextBoolean(), + dependencyKind = nextOption(nextString()), + dependencyTag = nextOption(nextString()) + ) + } +} |