Skip to content

Commit

Permalink
fix(document): adjust document name for presentation docs (#174)
Browse files Browse the repository at this point in the history
Refs: #166
Reviewed-By: Evelyn Gurschler <evelyn.gurschler@bmw.de>
  • Loading branch information
Phil91 authored Jun 17, 2024
1 parent ea2d55f commit e10cbcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ private async Task<Guid> HandleCredentialProcessCreation(
var documentContent = Encoding.UTF8.GetBytes(schema);
var hash = SHA512.HashData(documentContent);
var documentRepository = _repositories.GetInstance<IDocumentRepository>();
var docId = documentRepository.CreateDocument("schema.json", documentContent,
var docId = documentRepository.CreateDocument($"{typeId}.json", documentContent,
hash, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, x =>
{
x.IdentityId = _identity.IdentityId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ public async Task CreateBpnCredential_ReturnsExpected()
await _sut.CreateBpnCredential(data, CancellationToken.None);

// Assert
A.CallTo(() => _documentRepository.CreateDocument("schema.json", A<byte[]>._, A<byte[]>._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A<Action<Document>>._))
A.CallTo(() => _documentRepository.CreateDocument("BUSINESS_PARTNER_NUMBER.json", A<byte[]>._, A<byte[]>._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A<Action<Document>>._))
.MustHaveHappenedOnceExactly();
A.CallTo(() => _companySsiDetailsRepository.CreateSsiDetails(_identity.Bpnl, VerifiedCredentialTypeId.BUSINESS_PARTNER_NUMBER, CompanySsiDetailStatusId.ACTIVE, IssuerBpnl, _identity.IdentityId, A<Action<CompanySsiDetail>>._))
.MustHaveHappenedOnceExactly();
Expand Down Expand Up @@ -759,7 +759,7 @@ public async Task CreateMembershipCredential_ReturnsExpected()
await _sut.CreateMembershipCredential(data, CancellationToken.None);

// Assert
A.CallTo(() => _documentRepository.CreateDocument("schema.json", A<byte[]>._, A<byte[]>._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A<Action<Document>>._))
A.CallTo(() => _documentRepository.CreateDocument("MEMBERSHIP_CERTIFICATE.json", A<byte[]>._, A<byte[]>._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A<Action<Document>>._))
.MustHaveHappenedOnceExactly();
A.CallTo(() => _companySsiDetailsRepository.CreateSsiDetails(_identity.Bpnl, VerifiedCredentialTypeId.MEMBERSHIP_CERTIFICATE, CompanySsiDetailStatusId.ACTIVE, IssuerBpnl, _identity.IdentityId, A<Action<CompanySsiDetail>>._))
.MustHaveHappenedOnceExactly();
Expand Down Expand Up @@ -926,7 +926,7 @@ public async Task CreateFrameworkCredential_ReturnsExpected()
await _sut.CreateFrameworkCredential(data, CancellationToken.None);

// Assert
A.CallTo(() => _documentRepository.CreateDocument("schema.json", A<byte[]>._, A<byte[]>._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A<Action<Document>>._))
A.CallTo(() => _documentRepository.CreateDocument("TRACEABILITY_FRAMEWORK.json", A<byte[]>._, A<byte[]>._, MediaTypeId.JSON, DocumentTypeId.PRESENTATION, A<Action<Document>>._))
.MustHaveHappenedOnceExactly();
A.CallTo(() => _companySsiDetailsRepository.CreateSsiDetails(_identity.Bpnl, VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK, CompanySsiDetailStatusId.PENDING, IssuerBpnl, _identity.IdentityId, A<Action<CompanySsiDetail>>._))
.MustHaveHappenedOnceExactly();
Expand Down

0 comments on commit e10cbcb

Please sign in to comment.