forked from cloudfoundry/bosh-bootloader
/
bosh_cli_provider.go
39 lines (33 loc) · 1.19 KB
/
bosh_cli_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
package fakes
import (
"io"
"github.com/cloudfoundry/bosh-bootloader/bosh"
"github.com/cloudfoundry/bosh-bootloader/storage"
)
type BOSHCLIProvider struct {
AuthenticatedCLICall struct {
CallCount int
Receives struct {
Jumpbox storage.Jumpbox
Stderr io.Writer
DirectorAddress string
DirectorUsername string
DirectorPassword string
DirectorCACert string
}
Returns struct {
AuthenticatedCLI bosh.AuthenticatedCLIRunner
Error error
}
}
}
func (b *BOSHCLIProvider) AuthenticatedCLI(jumpbox storage.Jumpbox, stderr io.Writer, directorAddress, directorUsername, directorPassword, directorCACert string) (bosh.AuthenticatedCLIRunner, error) {
b.AuthenticatedCLICall.CallCount++
b.AuthenticatedCLICall.Receives.Jumpbox = jumpbox
b.AuthenticatedCLICall.Receives.Stderr = stderr
b.AuthenticatedCLICall.Receives.DirectorAddress = directorAddress
b.AuthenticatedCLICall.Receives.DirectorUsername = directorUsername
b.AuthenticatedCLICall.Receives.DirectorPassword = directorPassword
b.AuthenticatedCLICall.Receives.DirectorCACert = directorCACert
return b.AuthenticatedCLICall.Returns.AuthenticatedCLI, b.AuthenticatedCLICall.Returns.Error
}