/
mock.go
37 lines (29 loc) · 973 Bytes
/
mock.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
package subscription
import (
"github.com/Axway/agents-mulesoft/pkg/anypoint"
)
type MockMuleSubscriptionClient struct {
app *anypoint.Application
newApp *anypoint.Application
err error
rotateErr error
contract *anypoint.Contract
}
func (m *MockMuleSubscriptionClient) CreateApp(appName, apiID, description string) (*anypoint.Application, error) {
return m.app, m.err
}
func (m *MockMuleSubscriptionClient) CreateContract(apiID, tier string, appID int64) (*anypoint.Contract, error) {
return m.contract, m.err
}
func (m *MockMuleSubscriptionClient) DeleteApp(appName int64) error {
return m.err
}
func (m *MockMuleSubscriptionClient) DeleteContract(apiID, contractID string) error {
return m.err
}
func (m *MockMuleSubscriptionClient) GetApp(id string) (*anypoint.Application, error) {
return m.app, m.err
}
func (m *MockMuleSubscriptionClient) ResetAppSecret(appID int64) (*anypoint.Application, error) {
return m.newApp, m.rotateErr
}