-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add usecase unit test for s3 #24
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package mock | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/nao1215/rainbow/app/domain/service" | ||
) | ||
|
||
// S3BucketCreator is a mock of the S3BucketCreator interface. | ||
type S3BucketCreator func(ctx context.Context, input *service.S3BucketCreatorInput) (*service.S3BucketCreatorOutput, error) | ||
|
||
// CreateS3Bucket calls the CreateS3BucketFunc. | ||
func (m S3BucketCreator) CreateS3Bucket(ctx context.Context, input *service.S3BucketCreatorInput) (*service.S3BucketCreatorOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3BucketLister is a mock of the S3BucketLister interface. | ||
type S3BucketLister func(ctx context.Context, input *service.S3BucketListerInput) (*service.S3BucketListerOutput, error) | ||
|
||
// ListS3Buckets calls the ListS3BucketsFunc. | ||
func (m S3BucketLister) ListS3Buckets(ctx context.Context, input *service.S3BucketListerInput) (*service.S3BucketListerOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3BucketLocationGetter is a mock of the S3BucketLocationGetter interface. | ||
type S3BucketLocationGetter func(ctx context.Context, input *service.S3BucketLocationGetterInput) (*service.S3BucketLocationGetterOutput, error) | ||
|
||
// GetS3BucketLocation calls the GetS3BucketLocationFunc. | ||
func (m S3BucketLocationGetter) GetS3BucketLocation(ctx context.Context, input *service.S3BucketLocationGetterInput) (*service.S3BucketLocationGetterOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3ObjectsLister is a mock of the S3ObjectLister interface. | ||
type S3ObjectsLister func(ctx context.Context, input *service.S3ObjectsListerInput) (*service.S3ObjectsListerOutput, error) | ||
|
||
// ListS3Objects calls the ListS3ObjectsFunc. | ||
func (m S3ObjectsLister) ListS3Objects(ctx context.Context, input *service.S3ObjectsListerInput) (*service.S3ObjectsListerOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3ObjectsDeleter is a mock of the S3ObjectsDeleter interface. | ||
type S3ObjectsDeleter func(ctx context.Context, input *service.S3ObjectsDeleterInput) (*service.S3ObjectsDeleterOutput, error) | ||
|
||
// DeleteS3Objects calls the DeleteS3ObjectsFunc. | ||
func (m S3ObjectsDeleter) DeleteS3Objects(ctx context.Context, input *service.S3ObjectsDeleterInput) (*service.S3ObjectsDeleterOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3BucketDeleter is a mock of the S3BucketDeleter interface. | ||
type S3BucketDeleter func(ctx context.Context, input *service.S3BucketDeleterInput) (*service.S3BucketDeleterOutput, error) | ||
|
||
// DeleteS3Bucket calls the DeleteS3BucketFunc. | ||
func (m S3BucketDeleter) DeleteS3Bucket(ctx context.Context, input *service.S3BucketDeleterInput) (*service.S3BucketDeleterOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3ObjectUploader is a mock of the S3ObjectUploader interface. | ||
type S3ObjectUploader func(ctx context.Context, input *service.S3ObjectUploaderInput) (*service.S3ObjectUploaderOutput, error) | ||
|
||
// UploadS3Object calls the UploadS3ObjectFunc. | ||
func (m S3ObjectUploader) UploadS3Object(ctx context.Context, input *service.S3ObjectUploaderInput) (*service.S3ObjectUploaderOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3BucketPublicAccessBlocker is a mock of the S3BucketPublicAccessBlocker interface. | ||
type S3BucketPublicAccessBlocker func(ctx context.Context, input *service.S3BucketPublicAccessBlockerInput) (*service.S3BucketPublicAccessBlockerOutput, error) | ||
|
||
// BlockS3BucketPublicAccess calls the BlockS3BucketPublicAccessFunc. | ||
func (m S3BucketPublicAccessBlocker) BlockS3BucketPublicAccess(ctx context.Context, input *service.S3BucketPublicAccessBlockerInput) (*service.S3BucketPublicAccessBlockerOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3BucketPolicySetter is a mock of the S3BucketPolicySetter interface. | ||
type S3BucketPolicySetter func(ctx context.Context, input *service.S3BucketPolicySetterInput) (*service.S3BucketPolicySetterOutput, error) | ||
|
||
// SetS3BucketPolicy calls the SetS3BucketPolicyFunc. | ||
func (m S3BucketPolicySetter) SetS3BucketPolicy(ctx context.Context, input *service.S3BucketPolicySetterInput) (*service.S3BucketPolicySetterOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3ObjectDownloader is a mock of the S3ObjectDownloader interface. | ||
type S3ObjectDownloader func(ctx context.Context, input *service.S3ObjectDownloaderInput) (*service.S3ObjectDownloaderOutput, error) | ||
|
||
// DownloadS3Object calls the DownloadS3ObjectFunc. | ||
func (m S3ObjectDownloader) DownloadS3Object(ctx context.Context, input *service.S3ObjectDownloaderInput) (*service.S3ObjectDownloaderOutput, error) { | ||
return m(ctx, input) | ||
} | ||
|
||
// S3ObjectCopier is a mock of the S3ObjectCopier interface. | ||
type S3ObjectCopier func(ctx context.Context, input *service.S3ObjectCopierInput) (*service.S3ObjectCopierOutput, error) | ||
|
||
// CopyS3Object calls the CopyS3ObjectFunc. | ||
func (m S3ObjectCopier) CopyS3Object(ctx context.Context, input *service.S3ObjectCopierInput) (*service.S3ObjectCopierOutput, error) { | ||
return m(ctx, input) | ||
} |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🚫 [golangci] reported by reviewdog 🐶
ST1000: at least one file in a package should have a package comment (stylecheck)