Skip to content

Commit

Permalink
Add positive integration tests for testing
Browse files Browse the repository at this point in the history
resourceVersionTime query with different date formats.
  • Loading branch information
abdulla-ashurov committed Jun 19, 2023
1 parent a3410a1 commit b14c836
Showing 1 changed file with 126 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,132 @@ var _ = DescribeTable("Positive: Get Collection of Resources with resourceVersio
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (Layout format)",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
url.QueryEscape("01/25 00:08:40PM '23 +0000"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (ANSIC format)",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
url.QueryEscape("Wed Jan 25 12:08:40 2023"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (UnixDate format)",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
url.QueryEscape("Wed Jan 25 12:08:40 UTC 2023"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (RubyDate format)",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
url.QueryEscape("Wed Jan 25 12:08:40 +0000 2023"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (RFC822 format)",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
url.QueryEscape("25 Jan 23 12:09 UTC"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (RFC822Z format)",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
url.QueryEscape("25 Jan 23 12:09 +0000"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (RFC850 format)",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
url.QueryEscape("Wednesday, 25-Jan-23 12:08:40 UTC"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (RFC1123 format)",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
url.QueryEscape("Wed, 25 Jan 2023 12:08:40 UTC"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (RFC1123Z format)",
utils.PositiveTestCase{
DidURL: fmt.Sprintf(
"http://localhost:8080/1.0/identifiers/%s?resourceVersionTime=%s&resourceMetadata=true",
testconstants.UUIDStyleTestnetDid,
url.QueryEscape("Wed, 25 Jan 2023 12:08:40 +0000"),
),
ResolutionType: testconstants.DefaultResolutionType,
ExpectedJSONPath: "../../../testdata/query/resource_version_time/resource.json",
ExpectedStatusCode: http.StatusOK,
},
),

Entry(
"can get collection of resources with an existent resourceVersionTime query parameter (RFC3339 format)",
utils.PositiveTestCase{
Expand Down

0 comments on commit b14c836

Please sign in to comment.