Skip to content

Commit

Permalink
Add additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Feb 10, 2025
1 parent 1a2176d commit 252c4fc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions tests/integration/rest/resource/data/positive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,38 @@ var _ = DescribeTable("Positive: Get resource data", func(testCase utils.Positiv
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get resource with an existent DID, with multiple headers without q values",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://%s/1.0/identifiers/%s/resources/%s",
testconstants.TestHostAddress,
testconstants.UUIDStyleTestnetDid,
testconstants.UUIDStyleTestnetDidResourceId,
),
ResolutionType: "*/*," + string(types.JSONLD) + ";profile=" + string(types.W3IDDIDURL),
EncodingType: testconstants.DefaultEncodingType,
ExpectedEncodingType: "gzip",
ExpectedJSONPath: "../../testdata/resource_data/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get resource with an existent DID, with multiple header and q values",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://%s/1.0/identifiers/%s/resources/%s",
testconstants.TestHostAddress,
testconstants.UUIDStyleTestnetDid,
testconstants.UUIDStyleTestnetDidResourceId,
),
ResolutionType: string(types.JSONLD) + ";profile=" + string(types.W3IDDIDURL) + ";q=0.5,application/json,text/plain;q=0.9,image/png;q=0.7",
EncodingType: testconstants.DefaultEncodingType,
ExpectedEncodingType: "gzip",
ExpectedJSONPath: "../../testdata/resource_data/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var _ = DescribeTable("Positive: Get resource data with metadata", func(testCase
testconstants.UUIDStyleTestnetDid,
testconstants.UUIDStyleTestnetDidResourceId,
),
ResolutionType: string(types.JSONLD) + ";profile=" + string(types.W3IDDIDURL) + ";q=1.0,application/ld+json, application/json, text/plain;q=0.9, image/png;q=0.7",
ResolutionType: string(types.JSONLD) + ";profile=" + string(types.W3IDDIDURL) + ";q=1.0,application/json;q=0.9,image/png;q=0.7",
EncodingType: testconstants.DefaultEncodingType,
ExpectedEncodingType: "gzip",
ExpectedJSONPath: "../../testdata/resource_data_with_metadata/resource.json",
Expand Down

0 comments on commit 252c4fc

Please sign in to comment.