From 2b368e2c64eba193a84ea93718b43a307f45f026 Mon Sep 17 00:00:00 2001 From: Daniel Slapman Date: Mon, 30 Jan 2023 13:24:27 +0100 Subject: [PATCH] Fix no_body request mode --- .../ru/tinkoff/tcb/mockingbird/model/HttpStubRequest.scala | 5 +++-- backend/project/Settings.scala | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/mockingbird/src/main/scala/ru/tinkoff/tcb/mockingbird/model/HttpStubRequest.scala b/backend/mockingbird/src/main/scala/ru/tinkoff/tcb/mockingbird/model/HttpStubRequest.scala index a72b00eb..abf469a8 100644 --- a/backend/mockingbird/src/main/scala/ru/tinkoff/tcb/mockingbird/model/HttpStubRequest.scala +++ b/backend/mockingbird/src/main/scala/ru/tinkoff/tcb/mockingbird/model/HttpStubRequest.scala @@ -212,7 +212,8 @@ final case class RequestWithoutBody( query: Map[JsonOptic, Map[Keyword.Json, Json]] = Map.empty ) extends HttpStubRequest { override def checkBody(rBody: RequestBody): Boolean = - AbsentRequestBody.subset.getOption(rBody).isDefined + AbsentRequestBody.subset.getOption(rBody).isDefined || + SimpleRequestBody.subset.getOption(rBody).exists(_.value.isEmpty) override def extractJson(rBody: RequestBody): Option[Json] = None @@ -227,7 +228,7 @@ final case class RequestWithAnyBody( query: Map[JsonOptic, Map[Keyword.Json, Json]] = Map.empty ) extends HttpStubRequest { override def checkBody(rBody: RequestBody): Boolean = - AbsentRequestBody.subset.getOption(rBody).isEmpty + SimpleRequestBody.subset.getOption(rBody).exists(_.value.nonEmpty) override def extractJson(rBody: RequestBody): Option[Json] = None diff --git a/backend/project/Settings.scala b/backend/project/Settings.scala index 6f053164..93f64a49 100644 --- a/backend/project/Settings.scala +++ b/backend/project/Settings.scala @@ -26,7 +26,7 @@ object Settings { val common = Seq( organization := "ru.tinkoff", - version := "3.5.0", + version := "3.5.1", scalaVersion := "2.13.10", Compile / packageDoc / publishArtifact := false, Compile / packageSrc / publishArtifact := false,