-
Notifications
You must be signed in to change notification settings - Fork 3
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
SDKQE-3460 :- Add dapi alpha api's tests #218
base: master
Are you sure you want to change the base?
SDKQE-3460 :- Add dapi alpha api's tests #218
Conversation
@@ -11,3 +14,757 @@ func (s *GatewayOpsTestSuite) TestDapiAlphaEnabled() { | |||
}) | |||
requireRestSuccess(s.T(), resp) | |||
} | |||
|
|||
func (s *GatewayOpsTestSuite) insertBinaryDocument() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be using one of the existing test functions that exist for pushing document contents to the cluster for tests. Alternatively if there is some specific reason for having this use the DAPI mechanism, it should likely use a normal POST with Content-Type of binary to reflect the actual name of the method (insert as opposed to increment).
assertRestValidMutationToken(s.T(), resp, s.bucketName) | ||
|
||
// Verify the key-value is present | ||
resp = s.sendTestHttpRequest(&testHttpRequest{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should reuse the existing validation methods that are built into the test framework (see the POST/GET/PUT tests in dapi_crud_test.go).
assert.Contains(s.T(), string(resp.Body), string(TEST_APPEND_CONTENT)) | ||
}) | ||
|
||
s.Run("Forbidden", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test appears to be testing an output of the endpoint as opposed to testing the specific case. I believe there are a couple of cases which will lead to Forbidden such as InvalidAuth, Unauthenticated and PermissionDenied. See dapi_crud_test.go for examples of these. Additionally, I believe the test framework includes a mechanism for automatically running all these common failure cases.
No description provided.