Skip to content

Commit

Permalink
Final stage (0.7.5 -> 0.8.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
danslapman committed Jan 2, 2024
1 parent 0225aa2 commit efdda79
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion backend/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ val mockingbird = (project in file("mockingbird"))
"com.softwaremill.sttp.client4" %% "circe" % Versions.sttp,
"org.javassist" % "javassist" % "3.29.2-GA", // Armeria dependency
"org.apache.tika" % "tika-core" % "2.1.0",
"io.scalaland" %% "chimney" % "0.7.5",
"io.scalaland" %% "chimney" % "0.8.5",
"com.ironcorelabs" %% "cats-scalatest" % "3.0.8" % Test,
"com.google.code.findbugs" % "jsr305" % "3.0.2" % Optional,
"com.github.dwickern" %% "scala-nameof" % "4.0.0" % Provided,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ final class AdminApiHandler(
now <- ZIO.clockWith(_.instant)
stub = body
.into[GrpcStub]
.enableDefaultValues
.withFieldComputed(_.id, _ => SID.random[GrpcStub])
.withFieldConst(_.created, now)
.withFieldComputed(_.times, _.times.map(_.value))
.withFieldComputed(_.requestSchema, _ => requestSchema)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object UpdateScenarioRequest {
case class ScenarioPatch(
@BsonKey("_id") id: SID[Scenario],
scope: Scope,
times: Option[Int] = Some(1),
times: Option[Int],
service: String,
name: String,
source: SID[SourceConfiguration],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ru.tinkoff.tcb.mockingbird.model

import java.time.Instant
import java.util.UUID

import derevo.circe.decoder
import derevo.circe.encoder
Expand All @@ -27,11 +26,11 @@ import ru.tinkoff.tcb.validation.Rule

@derive(bsonDecoder, bsonEncoder, decoder, encoder, schema)
case class GrpcStub(
@BsonKey("_id") id: SID[GrpcStub] = SID(UUID.randomUUID().toString),
@BsonKey("_id") id: SID[GrpcStub],
scope: Scope,
created: Instant,
service: String,
times: Option[Int] = Some(1),
times: Option[Int],
methodName: String,
name: String,
requestSchema: GrpcProtoDefinition,
Expand All @@ -42,7 +41,7 @@ case class GrpcStub(
seed: Option[Json],
state: Option[Map[JsonOptic, Map[Keyword.Json, Json]]],
requestPredicates: JsonPredicate,
labels: Seq[String] = Seq.empty
labels: Seq[String]
)

object GrpcStub {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final case class HttpStub(
@description("Тип конфигурации")
scope: Scope,
@description("Количество возможных срабатываний. Имеет смысл только для scope=countdown")
times: Option[Int] = Some(1),
times: Option[Int],
serviceSuffix: String,
@description("Название мока")
name: String,
Expand All @@ -57,7 +57,7 @@ final case class HttpStub(
@description("Спецификация колбека")
callback: Option[Callback],
@description("Тэги")
labels: Seq[String] = Seq.empty
labels: Seq[String]
)

object HttpStub extends CallbackChecker {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ case class Scenario(
@description("Тип конфигурации")
scope: Scope,
@description("Количество возможных срабатываний. Имеет смысл только для scope=countdown")
times: Option[Int] = Some(1),
times: Option[Int],
service: String,
@description("Имя сценария, отображается в логах, полезно для отладки")
name: String,
Expand All @@ -54,7 +54,7 @@ case class Scenario(
@description("Спецификация колбека")
callback: Option[Callback],
@description("Тэги")
labels: Seq[String] = Seq.empty
labels: Seq[String]
)

object Scenario extends CallbackChecker {
Expand Down

0 comments on commit efdda79

Please sign in to comment.