Skip to content

Commit

Permalink
PIN-4257 Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
nttdata-rtorsoli committed Nov 28, 2023
1 parent 0d16d18 commit 999fc4d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 999fc4d

Please sign in to comment.