From 571fc34fb0b966becfdd3304a62afd6d5a98df10 Mon Sep 17 00:00:00 2001 From: Stefano Perazzolo <13318704+beetlecrunch@users.noreply.github.com> Date: Fri, 19 Jan 2024 17:14:13 +0100 Subject: [PATCH] PIN-4435: fix publish descriptor response handler --- .../interop/catalogprocess/api/impl/ResponseHandlers.scala | 1 + .../it/pagopa/interop/catalogprocess/CatalogProcessSpec.scala | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/it/pagopa/interop/catalogprocess/api/impl/ResponseHandlers.scala b/src/main/scala/it/pagopa/interop/catalogprocess/api/impl/ResponseHandlers.scala index 1cad3126..04d2dca8 100644 --- a/src/main/scala/it/pagopa/interop/catalogprocess/api/impl/ResponseHandlers.scala +++ b/src/main/scala/it/pagopa/interop/catalogprocess/api/impl/ResponseHandlers.scala @@ -189,6 +189,7 @@ object ResponseHandlers extends AkkaResponses { case Failure(ex: EServiceDescriptorWithoutInterface) => badRequest(ex, logMessage) case Failure(ex: EServiceRiskAnalysisIsRequired) => badRequest(ex, logMessage) case Failure(ex: RiskAnalysisNotValid.type) => badRequest(ex, logMessage) + case Failure(ex: NotValidDescriptor) => badRequest(ex, logMessage) case Failure(ex) => internalServerError(ex, logMessage) } diff --git a/src/test/scala/it/pagopa/interop/catalogprocess/CatalogProcessSpec.scala b/src/test/scala/it/pagopa/interop/catalogprocess/CatalogProcessSpec.scala index 8b9bed4c..3d83eefc 100644 --- a/src/test/scala/it/pagopa/interop/catalogprocess/CatalogProcessSpec.scala +++ b/src/test/scala/it/pagopa/interop/catalogprocess/CatalogProcessSpec.scala @@ -1454,7 +1454,7 @@ class CatalogProcessSpec extends SpecHelper with AnyWordSpecLike with ScalatestR SpecData.catalogItem.id.toString, SpecData.catalogDescriptor.id.toString ) ~> check { - status shouldEqual StatusCodes.InternalServerError + status shouldEqual StatusCodes.BadRequest } } "fail if EService does not exist" in {