Skip to content

Commit

Permalink
Merge branch '1.0.x' into PIN-3142
Browse files Browse the repository at this point in the history
  • Loading branch information
nttdata-rtorsoli authored Jul 28, 2023
2 parents 44f7ac5 + 5aaf608 commit 86bd783
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/resources/interface-specification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ paths:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'/compute/agreementsState/consumers/{consumerId}/attributes/{attributeId}':
'/compute/agreementsState':
parameters:
- $ref: '#/components/parameters/CorrelationIdHeader'
- $ref: '#/components/parameters/IpAddress'
Expand Down Expand Up @@ -1055,7 +1055,6 @@ components:
format: date-time
required:
- id
- kind
- assignmentTimestamp
CertifiedTenantAttribute:
type: object
Expand All @@ -1071,7 +1070,6 @@ components:
format: date-time
required:
- id
- kind
- assignmentTimestamp
VerifiedTenantAttribute:
type: object
Expand All @@ -1092,7 +1090,6 @@ components:
$ref: '#/components/schemas/TenantRevoker'
required:
- id
- kind
- assignmentTimestamp
- verifiedBy
- revokedBy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,12 @@ final case class AgreementApiServiceImpl(
stamps = agreement.stamps.copy(archiving = AgreementManagement.Stamp(uid, offsetDateTimeSupplier.get()).some)
)
)
_ <- authorizationManagementService.updateStateOnClients(
eServiceId = agreement.eserviceId,
consumerId = agreement.consumerId,
agreementId = agreement.id,
state = AuthorizationManagement.ClientComponentState.INACTIVE
)
} yield agreement

val result: Future[Agreement] = for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import akka.http.scaladsl.testkit.ScalatestRouteTest
import it.pagopa.interop.agreementmanagement.client.{model => AgreementManagement}
import it.pagopa.interop.agreementprocess.events.ArchiveEvent
import it.pagopa.interop.agreementprocess.common.Adapters._
import it.pagopa.interop.authorizationmanagement.client.model.ClientComponentState
import org.scalatest.matchers.should.Matchers._
import org.scalatest.wordspec.AnyWordSpecLike

import java.util.UUID
import scala.concurrent.Future

class AgreementArchiviationSpec extends AnyWordSpecLike with SpecHelper with ScalatestRouteTest {

Expand All @@ -31,6 +33,11 @@ class AgreementArchiviationSpec extends AnyWordSpecLike with SpecHelper with Sca
val now = SpecData.when
mockAgreementRetrieve(agreement.toPersistent)
mockAgreementUpdate(agreement.id, expectedSeed, agreement.copy(stamps = SpecData.archiviationStamps))
(mockAuthorizationManagementService
.updateStateOnClients(_: UUID, _: UUID, _: UUID, _: ClientComponentState)(_: Seq[(String, String)]))
.expects(agreement.eserviceId, agreement.consumerId, agreement.id, ClientComponentState.INACTIVE, *)
.once()
.returns(Future.unit)
mockArchiveEventSending(ArchiveEvent(agreement.id, now)).twice()

Get() ~> service.archiveAgreement(agreement.id.toString) ~> check {
Expand Down

0 comments on commit 86bd783

Please sign in to comment.