Skip to content

Commit 8ad7c4b

Browse files
committed
fix test
1 parent e067e53 commit 8ad7c4b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

api/user_buckets_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,8 @@ func TestSetBucketAccess(t *testing.T) {
364364

365365
func Test_enableBucketEncryption(t *testing.T) {
366366
ctx := context.Background()
367-
minClient := minioClientMock{}
368367
type args struct {
369368
ctx context.Context
370-
client MinioClient
371369
bucketName string
372370
encryptionType models.BucketEncryptionType
373371
kmsKeyID string
@@ -382,7 +380,6 @@ func Test_enableBucketEncryption(t *testing.T) {
382380
name: "Bucket encryption enabled correctly",
383381
args: args{
384382
ctx: ctx,
385-
client: minClient,
386383
bucketName: "test",
387384
encryptionType: "sse-s3",
388385
mockEnableBucketEncryptionFunc: func(_ context.Context, _ string, _ *sse.Configuration) error {
@@ -395,7 +392,6 @@ func Test_enableBucketEncryption(t *testing.T) {
395392
name: "Error when enabling bucket encryption",
396393
args: args{
397394
ctx: ctx,
398-
client: minClient,
399395
bucketName: "test",
400396
encryptionType: "sse-s3",
401397
mockEnableBucketEncryptionFunc: func(_ context.Context, _ string, _ *sse.Configuration) error {
@@ -407,8 +403,9 @@ func Test_enableBucketEncryption(t *testing.T) {
407403
}
408404
for _, tt := range tests {
409405
t.Run(tt.name, func(_ *testing.T) {
406+
minClient := minioClientMock{}
410407
minClient.setBucketEncryptionMock = tt.args.mockEnableBucketEncryptionFunc
411-
if err := enableBucketEncryption(tt.args.ctx, tt.args.client, tt.args.bucketName, tt.args.encryptionType, tt.args.kmsKeyID); (err != nil) != tt.wantErr {
408+
if err := enableBucketEncryption(tt.args.ctx, minClient, tt.args.bucketName, tt.args.encryptionType, tt.args.kmsKeyID); (err != nil) != tt.wantErr {
412409
t.Errorf("enableBucketEncryption() errors = %v, wantErr %v", err, tt.wantErr)
413410
}
414411
})

0 commit comments

Comments
 (0)