1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-15 17:51:01 +00:00

Completed tests for Oracle ValidateStore

This commit is contained in:
Marcin Kubica 2022-05-05 16:29:29 +01:00
parent b0719d2f54
commit c0a305f04b
No known key found for this signature in database
GPG key ID: CD4DC80128770362

View file

@ -276,21 +276,19 @@ func TestValidateStore(t *testing.T) {
store: makeSecretStore("vault-OCID", "some-region", withSecretAuth("user-OCID", "a-tenant"), withPrivateKey("bob", "key", nil), withFingerprint("kelly", "", nil)),
err: fmt.Errorf("fingerprint.key cannot be empty"),
},
{
store: makeSecretStore("vault-OCID", "some-region"),
err: nil,
},
}
p := VaultManagementService{}
for _, tc := range testCases {
err := p.ValidateStore(tc.store)
if err.Error() != tc.err.Error() {
if tc.err != nil && err.Error() != tc.err.Error() {
t.Errorf("test failed! want %v, got %v", tc.err, err)
} else if tc.err == nil && err != nil {
t.Errorf("want nil got err %v", err)
}
}
}
func TestValidateStoreSuccess(t *testing.T) {
p := VaultManagementService{}
store := makeSecretStore("some-OCID", "some-region")
err := p.ValidateStore(store)
if err != nil {
t.Errorf("want nil got err")
}
}