Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add BDD test for retrieving documents by versionID #1149

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

sandrask
Copy link
Contributor

Update sidetree-core, add BDD test for retrieving documents by versionId.

Closes #1148

Signed-off-by: Sandra Vrtikapa sandra.vrtikapa@securekey.com

@cla-bot cla-bot bot added the cla-signed label Feb 25, 2022
@codecov
Copy link

codecov bot commented Feb 25, 2022

Codecov Report

Merging #1149 (0f38e98) into main (9b9607c) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1149      +/-   ##
==========================================
+ Coverage   88.92%   88.99%   +0.06%     
==========================================
  Files         168      168              
  Lines       16260    16261       +1     
==========================================
+ Hits        14460    14472      +12     
+ Misses       1112     1103       -9     
+ Partials      688      686       -2     
Impacted Files Coverage Δ
pkg/anchor/writer/writer.go 89.62% <ø> (ø)
pkg/document/updatehandler/decorator/decorator.go 100.00% <ø> (ø)
...r/resource/registry/didanchorinfo/didanchorinfo.go 100.00% <ø> (ø)
pkg/document/resolvehandler/resolvehandler.go 98.71% <100.00%> (+<0.01%) ⬆️
...orbclient/resolutionverifier/resolutionverifier.go 88.96% <100.00%> (ø)
pkg/activitypub/service/monitoring/monitoring.go 80.18% <0.00%> (+2.83%) ⬆️
...pub/service/inbox/httpsubscriber/httpsubscriber.go 100.00% <0.00%> (+9.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b9607c...0f38e98. Read the comment docs.

Then check success response contains "thirdKey"

# start version queries
When client sends request to "https://orb.domain1.com/sidetree/v1/identifiers" to resolve DID document with canonical did and version index 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does version index mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a way of collecting version ids in BDD test - I will change it as per our conversation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -807,6 +821,22 @@ func (d *DIDOrbSteps) resolveDIDDocumentWithCanonicalDID(url string) error {
return d.resolveDIDDocumentWithID(url, d.canonicalDID)
}

func (d *DIDOrbSteps) resolveDIDDocumentWithCanonicalDIDAndVersion(url, version string) error {
logger.Infof("resolving did document with canonical did %s and version %s", d.canonicalDID, version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do this:

if err := d.state.resolveVarsInExpression(&version); err != nil {
  return err
}

didWithParam := d.canonicalDID + "?versionId=" + version


Then check success response contains "canonicalId"
Then the JSON path 'didDocumentMetadata.versionId' of the response is saved to variable "v0"

When client sends request to "https://orb.domain1.com/sidetree/v1/identifiers" to resolve DID document with canonical did and version "v0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do this instead:

. . . canonical did and version "${v0}"

Update sidetree-core, add BDD test for retrieving documents by versionId.

Closes trustbloc#1148

Signed-off-by: Sandra Vrtikapa <sandra.vrtikapa@securekey.com>
@fqutishat fqutishat merged commit 2119181 into trustbloc:main Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BDD test for resolver DID with versionId
3 participants