forked from cloudfoundry/bosh-bootloader
/
aws_client_provider.go
55 lines (49 loc) · 1.25 KB
/
aws_client_provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package fakes
import (
"github.com/cloudfoundry/bosh-bootloader/aws"
"github.com/cloudfoundry/bosh-bootloader/aws/cloudformation"
"github.com/cloudfoundry/bosh-bootloader/aws/ec2"
"github.com/cloudfoundry/bosh-bootloader/aws/iam"
)
type AWSClientProvider struct {
SetConfigCall struct {
CallCount int
Receives struct {
Config aws.Config
}
}
GetEC2ClientCall struct {
CallCount int
Returns struct {
EC2Client ec2.Client
}
}
GetCloudFormationClientCall struct {
CallCount int
Returns struct {
CloudFormationClient cloudformation.Client
}
}
GetIAMClientCall struct {
CallCount int
Returns struct {
IAMClient iam.Client
}
}
}
func (c *AWSClientProvider) SetConfig(config aws.Config) {
c.SetConfigCall.CallCount++
c.SetConfigCall.Receives.Config = config
}
func (c *AWSClientProvider) GetEC2Client() ec2.Client {
c.GetEC2ClientCall.CallCount++
return c.GetEC2ClientCall.Returns.EC2Client
}
func (c *AWSClientProvider) GetCloudFormationClient() cloudformation.Client {
c.GetCloudFormationClientCall.CallCount++
return c.GetCloudFormationClientCall.Returns.CloudFormationClient
}
func (c *AWSClientProvider) GetIAMClient() iam.Client {
c.GetIAMClientCall.CallCount++
return c.GetIAMClientCall.Returns.IAMClient
}