forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_config2.go
86 lines (66 loc) · 1.93 KB
/
fake_config2.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package configfakes
import (
"github.com/cloudfoundry/bosh-cli/cmd/config"
"github.com/cloudfoundry/bosh-cli/uaa"
)
type FakeConfig2 struct {
Existing ConfigContents
AliasEnvironmentErr error
Saved *ConfigContents
SaveErr error
}
type ConfigContents struct {
EnvironmentURL string
EnvironmentAlias string
EnvironmentCACert string
Called bool
}
func (f *FakeConfig2) Environment() string {
return f.Existing.EnvironmentURL
}
func (f *FakeConfig2) Environments() []config.Environment {
panic("Not implemented")
}
func (f *FakeConfig2) ResolveEnvironment(environmentOrName string) string {
return ""
}
func (f *FakeConfig2) AliasEnvironment(environment, alias, caCert string) (config.Config, error) {
f.Saved = &ConfigContents{}
return &FakeConfig2{
Existing: ConfigContents{
EnvironmentURL: environment,
EnvironmentAlias: alias,
EnvironmentCACert: caCert,
},
Saved: f.Saved,
SaveErr: f.SaveErr,
}, f.AliasEnvironmentErr
}
func (fake *FakeConfig2) UpdateConfigWithToken(environment string, t uaa.AccessToken) error {
panic("Not implemented")
}
func (f *FakeConfig2) CACert(environment string) string {
return f.Existing.EnvironmentCACert
}
func (f *FakeConfig2) Credentials(environment string) config.Creds {
panic("Not implemented")
}
func (f *FakeConfig2) SetCredentials(environment string, creds config.Creds) config.Config {
panic("Not implemented")
}
func (f *FakeConfig2) UnsetCredentials(environment string) config.Config {
panic("Not implemented")
}
func (f *FakeConfig2) Deployment(environment string) string {
panic("Not implemented")
}
func (f *FakeConfig2) SetDeployment(environment string, nameOrPath string) config.Config {
panic("Not implemented")
}
func (f *FakeConfig2) Save() error {
f.Saved.EnvironmentURL = f.Existing.EnvironmentURL
f.Saved.EnvironmentAlias = f.Existing.EnvironmentAlias
f.Saved.EnvironmentCACert = f.Existing.EnvironmentCACert
f.Saved.Called = true
return f.SaveErr
}