aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/fakes/entities/rep/BridgeUploadQueueGen.scala
diff options
context:
space:
mode:
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.scala31
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()
+ )
+ }
+
+}