-
Notifications
You must be signed in to change notification settings - Fork 157
/
privatekeypair_test.go
45 lines (41 loc) · 1.26 KB
/
privatekeypair_test.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
package atlas
import (
"testing"
"github.com/1Password/shell-plugins/sdk"
"github.com/1Password/shell-plugins/sdk/plugintest"
"github.com/1Password/shell-plugins/sdk/schema/fieldname"
)
func TestCredentialsProvisioner(t *testing.T) {
plugintest.TestProvisioner(t, PrivateKeyPair().DefaultProvisioner, map[string]plugintest.ProvisionCase{
"default": {
ItemFields: map[sdk.FieldName]string{
fieldname.PublicKey: "eexample",
fieldname.PrivateKey: "qohcbhiu-26ag-wpwf-maqn-cw5xlexample",
},
ExpectedOutput: sdk.ProvisionOutput{
Environment: map[string]string{
"MONGODB_ATLAS_PUBLIC_API_KEY": "eexample",
"MONGODB_ATLAS_PRIVATE_API_KEY": "qohcbhiu-26ag-wpwf-maqn-cw5xlexample",
},
},
},
})
}
func TestCredentialsImporter(t *testing.T) {
plugintest.TestImporter(t, PrivateKeyPair().Importer, map[string]plugintest.ImportCase{
"environment": {
Environment: map[string]string{
"MONGODB_ATLAS_PUBLIC_API_KEY": "eexample",
"MONGODB_ATLAS_PRIVATE_API_KEY": "qohcbhiu-26ag-wpwf-maqn-cw5xlexample",
},
ExpectedCandidates: []sdk.ImportCandidate{
{
Fields: map[sdk.FieldName]string{
fieldname.PublicKey: "eexample",
fieldname.PrivateKey: "qohcbhiu-26ag-wpwf-maqn-cw5xlexample",
},
},
},
},
})
}