-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* implement http testing * optimize code * chore: update mocks * fix code review * chore: update mocks * optimize cookies expiration logic * add test cases for test_response * fix:lint * use response recorder * update go mod * change cookie value type to string * chore: update mocks * remove mutex * update test response * add more test cases for test response * driver specific http testing process * directly use r.t * use Test method for testing * update cookie assertion logic * . * add isCookieExpired Method * optimize cookie expiration logic --------- Co-authored-by: kkumar-gcc <kkumar-gcc@users.noreply.github.com>
- Loading branch information
1 parent
1404bff
commit 8b33e6b
Showing
13 changed files
with
2,432 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package testing | ||
|
||
type TestRequest interface { | ||
WithHeaders(headers map[string]string) TestRequest | ||
WithHeader(key, value string) TestRequest | ||
WithoutHeader(key string) TestRequest | ||
WithCookies(cookies map[string]string) TestRequest | ||
WithCookie(key, value string) TestRequest | ||
Get(uri string) (TestResponse, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package testing | ||
|
||
type TestResponse interface { | ||
AssertStatus(status int) TestResponse | ||
AssertOk() TestResponse | ||
AssertCreated() TestResponse | ||
AssertAccepted() TestResponse | ||
AssertNoContent(status ...int) TestResponse | ||
AssertMovedPermanently() TestResponse | ||
AssertFound() TestResponse | ||
AssertNotModified() TestResponse | ||
AssertPartialContent() TestResponse | ||
AssertTemporaryRedirect() TestResponse | ||
AssertBadRequest() TestResponse | ||
AssertUnauthorized() TestResponse | ||
AssertPaymentRequired() TestResponse | ||
AssertForbidden() TestResponse | ||
AssertNotFound() TestResponse | ||
AssertMethodNotAllowed() TestResponse | ||
AssertNotAcceptable() TestResponse | ||
AssertConflict() TestResponse | ||
AssertRequestTimeout() TestResponse | ||
AssertGone() TestResponse | ||
AssertUnsupportedMediaType() TestResponse | ||
AssertUnprocessableEntity() TestResponse | ||
AssertTooManyRequests() TestResponse | ||
AssertInternalServerError() TestResponse | ||
AssertServiceUnavailable() TestResponse | ||
AssertHeader(headerName, value string) TestResponse | ||
AssertHeaderMissing(headerName string) TestResponse | ||
AssertCookie(name, value string) TestResponse | ||
AssertCookieExpired(name string) TestResponse | ||
AssertCookieNotExpired(name string) TestResponse | ||
AssertCookieMissing(name string) TestResponse | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.