diff --git a/src/main/scala/it/pagopa/interop/tenantprocess/api/impl/package.scala b/src/main/scala/it/pagopa/interop/tenantprocess/api/impl/package.scala index 4242636..31af247 100644 --- a/src/main/scala/it/pagopa/interop/tenantprocess/api/impl/package.scala +++ b/src/main/scala/it/pagopa/interop/tenantprocess/api/impl/package.scala @@ -43,7 +43,7 @@ package object impl extends SprayJsonSupport with DefaultJsonProtocol { implicit def tenantRevokerFormat: RootJsonFormat[TenantRevoker] = jsonFormat5(TenantRevoker) implicit def resourceIdFormat: RootJsonFormat[ResourceId] = jsonFormat1(ResourceId) - implicit def tenantFormat: RootJsonFormat[Tenant] = jsonFormat11(Tenant) + implicit def tenantFormat: RootJsonFormat[Tenant] = jsonFormat12(Tenant) implicit def tenantsFormat: RootJsonFormat[Tenants] = jsonFormat2(Tenants) implicit def problemErrorFormat: RootJsonFormat[ProblemError] = jsonFormat2(ProblemError) implicit def problemFormat: RootJsonFormat[Problem] = jsonFormat6(Problem) diff --git a/src/test/scala/it/pagopa/interop/tenantprocess/provider/TenantCreationSpec.scala b/src/test/scala/it/pagopa/interop/tenantprocess/provider/TenantCreationSpec.scala index 1d9ba0e..08c16f5 100644 --- a/src/test/scala/it/pagopa/interop/tenantprocess/provider/TenantCreationSpec.scala +++ b/src/test/scala/it/pagopa/interop/tenantprocess/provider/TenantCreationSpec.scala @@ -912,7 +912,6 @@ class TenantCreationSpec extends AnyWordSpecLike with SpecHelper with ScalatestR mockCreateTenant(expectedTenantSeed, tenant) mockUpdateTenant(tenantId, expectedTenantUpdate) - mockAddTenantMail(tenantId, dependencyMailSeed) Get() ~> tenantService.selfcareUpsertTenant(seed) ~> check { assert(status == StatusCodes.OK) @@ -946,7 +945,6 @@ class TenantCreationSpec extends AnyWordSpecLike with SpecHelper with ScalatestR mockCreateTenant(expectedTenantSeed, tenant) mockUpdateTenant(tenantId, expectedTenantUpdate) - mockAddTenantMail(tenantId, dependencyMailSeed) Get() ~> tenantService.selfcareUpsertTenant(seed) ~> check { assert(status == StatusCodes.OK) @@ -975,36 +973,6 @@ class TenantCreationSpec extends AnyWordSpecLike with SpecHelper with ScalatestR mockGetTenantByExternalId(PersistentExternalId(seed.externalId.origin, seed.externalId.value), tenant) mockUpdateTenant(tenantId, expectedTenantUpdate) - - Get() ~> tenantService.selfcareUpsertTenant(seed) ~> check { - assert(status == StatusCodes.OK) - } - } - - "SelfCare request - Update of an existing tenant must succeed if SelfCare ID is not set but with digitalAddress" in { - implicit val context: Seq[(String, String)] = selfcareContext - - val tenantId = organizationId - val seed = selfcareTenantSeed.copy(digitalAddress = Some(mailSeed)) - val tenant = persistentTenant.copy( - id = tenantId, - selfcareId = None, - features = List(PersistentTenantFeature.PersistentCertifier("something")) - ) - - val expectedTenantUpdate = - TenantDelta( - selfcareId = Some(seed.selfcareId), - features = Seq(TenantFeature(certifier = Some(Certifier("something")))), - kind = TenantKind.PA - ) - - mockDateTimeGet() - - mockGetTenantByExternalId(PersistentExternalId(seed.externalId.origin, seed.externalId.value), tenant) - mockUpdateTenant(tenantId, expectedTenantUpdate) - - mockAddTenantMail(tenantId, dependencyMailSeed) Get() ~> tenantService.selfcareUpsertTenant(seed) ~> check { assert(status == StatusCodes.OK) @@ -1057,8 +1025,6 @@ class TenantCreationSpec extends AnyWordSpecLike with SpecHelper with ScalatestR mockGetTenantByExternalId(PersistentExternalId(seed.externalId.origin, seed.externalId.value), tenant) - mockAddTenantMail(tenantId, dependencyMailSeed) - Get() ~> tenantService.selfcareUpsertTenant(seed) ~> check { assert(status == StatusCodes.OK) } @@ -1130,7 +1096,6 @@ class TenantCreationSpec extends AnyWordSpecLike with SpecHelper with ScalatestR mockGetTenantByExternalId(PersistentExternalId(seed.externalId.origin, seed.externalId.value), tenant) mockUpdateTenant(tenantId, expectedTenantUpdate) - mockAddTenantMail(tenantId, dependencyMailSeed) Get() ~> tenantService.selfcareUpsertTenant(seed) ~> check { assert(status == StatusCodes.OK)