forked from cloudfoundry-community/pe-rds-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_db_cluster.go
60 lines (47 loc) · 1.49 KB
/
fake_db_cluster.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
56
57
58
59
60
package fakes
import (
"github.com/cf-platform-eng/rds-broker/awsrds"
)
type FakeDBCluster struct {
DescribeCalled bool
DescribeID string
DescribeDBClusterDetails awsrds.DBClusterDetails
DescribeError error
CreateCalled bool
CreateID string
CreateDBClusterDetails awsrds.DBClusterDetails
CreateError error
ModifyCalled bool
ModifyID string
ModifyDBClusterDetails awsrds.DBClusterDetails
ModifyApplyImmediately bool
ModifyError error
DeleteCalled bool
DeleteID string
DeleteSkipFinalSnapshot bool
DeleteError error
}
func (f *FakeDBCluster) Describe(ID string) (awsrds.DBClusterDetails, error) {
f.DescribeCalled = true
f.DescribeID = ID
return f.DescribeDBClusterDetails, f.DescribeError
}
func (f *FakeDBCluster) Create(ID string, dbClusterDetails awsrds.DBClusterDetails) error {
f.CreateCalled = true
f.CreateID = ID
f.CreateDBClusterDetails = dbClusterDetails
return f.CreateError
}
func (f *FakeDBCluster) Modify(ID string, dbClusterDetails awsrds.DBClusterDetails, applyImmediately bool) error {
f.ModifyCalled = true
f.ModifyID = ID
f.ModifyDBClusterDetails = dbClusterDetails
f.ModifyApplyImmediately = applyImmediately
return f.ModifyError
}
func (f *FakeDBCluster) Delete(ID string, skipFinalSnapshot bool) error {
f.DeleteCalled = true
f.DeleteID = ID
f.DeleteSkipFinalSnapshot = skipFinalSnapshot
return f.DeleteError
}