File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed
ecs-cli/modules/clients/aws/secretsmanager Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -28,21 +28,19 @@ type SMClient interface {
28
28
29
29
type secretsManagerClient struct {
30
30
client secretsmanageriface.SecretsManagerAPI
31
- config * config.CommandConfig
32
31
}
33
32
34
33
// NewSecretsManagerClient creates an instance of an secretsManagerClient
35
34
func NewSecretsManagerClient (config * config.CommandConfig ) SMClient {
36
35
client := secretsmanager .New (config .Session )
37
36
client .Handlers .Build .PushBackNamed (clients .CustomUserAgentHandler ())
38
37
39
- return newClient (config , client )
38
+ return newClient (client )
40
39
}
41
40
42
- func newClient (config * config. CommandConfig , client secretsmanageriface.SecretsManagerAPI ) SMClient {
41
+ func newClient (client secretsmanageriface.SecretsManagerAPI ) SMClient {
43
42
return & secretsManagerClient {
44
43
client : client ,
45
- config : config ,
46
44
}
47
45
}
48
46
Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ import (
18
18
"testing"
19
19
20
20
"github.com/aws/amazon-ecs-cli/ecs-cli/modules/clients/aws/secretsmanager/mock/sdk"
21
- "github.com/aws/amazon-ecs-cli/ecs-cli/modules/config"
22
21
"github.com/aws/aws-sdk-go/aws"
23
- "github.com/aws/aws-sdk-go/aws/session"
24
22
"github.com/aws/aws-sdk-go/service/secretsmanager"
25
23
"github.com/golang/mock/gomock"
26
24
"github.com/stretchr/testify/assert"
@@ -97,10 +95,7 @@ func TestListSecretsErrorCase(t *testing.T) {
97
95
func setupTestController (t * testing.T ) (* mock_secretsmanageriface.MockSecretsManagerAPI , SMClient ) {
98
96
ctrl := gomock .NewController (t )
99
97
mockSM := mock_secretsmanageriface .NewMockSecretsManagerAPI (ctrl )
100
- mockSession , err := session .NewSession ()
101
- assert .NoError (t , err , "Unexpected error in creating session" )
102
-
103
- client := newClient (& config.CommandConfig {Session : mockSession }, mockSM )
98
+ client := newClient (mockSM )
104
99
105
100
return mockSM , client
106
101
}
You can’t perform that action at this time.
0 commit comments