mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Add bucket-notification-handler tests (#2750)
This commit is contained in:
committed by
Harshavardhana
parent
90417d2dd6
commit
559ad38b8c
@@ -942,6 +942,7 @@ func getMultiDeleteObjectURL(endPoint, bucketName string) string {
|
||||
queryValue := url.Values{}
|
||||
queryValue.Set("delete", "")
|
||||
return makeTestTargetURL(endPoint, bucketName, "", queryValue)
|
||||
|
||||
}
|
||||
|
||||
// return URL for HEAD on the object.
|
||||
@@ -1095,6 +1096,18 @@ func getCompleteMultipartUploadURL(endPoint, bucketName, objectName, uploadID st
|
||||
return makeTestTargetURL(endPoint, bucketName, objectName, queryValue)
|
||||
}
|
||||
|
||||
// return URL for put bucket notification.
|
||||
func getPutBucketNotificationURL(endPoint, bucketName string) string {
|
||||
return getGetBucketNotificationURL(endPoint, bucketName)
|
||||
}
|
||||
|
||||
// return URL for get bucket notification.
|
||||
func getGetBucketNotificationURL(endPoint, bucketName string) string {
|
||||
queryValue := url.Values{}
|
||||
queryValue.Set("notification", "")
|
||||
return makeTestTargetURL(endPoint, bucketName, "", queryValue)
|
||||
}
|
||||
|
||||
// returns temp root directory. `
|
||||
func getTestRoot() (string, error) {
|
||||
return ioutil.TempDir(os.TempDir(), "api-")
|
||||
@@ -1324,6 +1337,11 @@ func initTestAPIEndPoints(objLayer ObjectLayer, apiFunctions []string) http.Hand
|
||||
// Register ListMultipartUploads handler.
|
||||
case "ListMultipartUploads":
|
||||
bucket.Methods("GET").HandlerFunc(api.ListMultipartUploadsHandler).Queries("uploads", "")
|
||||
// Register GetBucketNotification Handler.
|
||||
case "GetBucketNotification":
|
||||
bucket.Methods("GET").HandlerFunc(api.GetBucketNotificationHandler).Queries("notification", "")
|
||||
case "PutBucketNotification":
|
||||
bucket.Methods("PUT").HandlerFunc(api.PutBucketNotificationHandler).Queries("notification", "")
|
||||
// Register all api endpoints by default.
|
||||
default:
|
||||
registerAPIRouter(muxRouter, api)
|
||||
|
||||
Reference in New Issue
Block a user