4
4
"encoding/json"
5
5
"fmt"
6
6
"io"
7
- "io/ioutil"
8
7
"strings"
9
8
"testing"
10
9
@@ -32,7 +31,7 @@ type mockProgram struct {
32
31
// Output returns responses from the remote credentials helper.
33
32
// It mocks those responses based in the input in the mock.
34
33
func (m * mockProgram ) Output () ([]byte , error ) {
35
- in , err := ioutil .ReadAll (m .input )
34
+ in , err := io .ReadAll (m .input )
36
35
if err != nil {
37
36
return nil , err
38
37
}
@@ -108,8 +107,8 @@ func ExampleStore() {
108
107
109
108
func TestStore (t * testing.T ) {
110
109
valid := []credentials.Credentials {
111
- {validServerAddress , "foo" , "bar" },
112
- {validServerAddress2 , "<token>" , "abcd1234" },
110
+ {ServerURL : validServerAddress , Username : "foo" , Secret : "bar" },
111
+ {ServerURL : validServerAddress2 , Username : "<token>" , Secret : "abcd1234" },
113
112
}
114
113
115
114
for _ , v := range valid {
@@ -119,7 +118,7 @@ func TestStore(t *testing.T) {
119
118
}
120
119
121
120
invalid := []credentials.Credentials {
122
- {invalidServerAddress , "foo" , "bar" },
121
+ {ServerURL : invalidServerAddress , Username : "foo" , Secret : "bar" },
123
122
}
124
123
125
124
for _ , v := range invalid {
@@ -142,8 +141,8 @@ func ExampleGet() {
142
141
143
142
func TestGet (t * testing.T ) {
144
143
valid := []credentials.Credentials {
145
- {validServerAddress , "foo" , "bar" },
146
- {validServerAddress2 , "<token>" , "abcd1234" },
144
+ {ServerURL : validServerAddress , Username : "foo" , Secret : "bar" },
145
+ {ServerURL : validServerAddress2 , Username : "<token>" , Secret : "abcd1234" },
147
146
}
148
147
149
148
for _ , v := range valid {
0 commit comments