Add some extra coverage.

This commit is contained in:
Mariano Cano 2021-10-05 20:41:55 -07:00
parent 6389100325
commit 56c3559e52

View file

@ -70,6 +70,13 @@ func createJWK(t *testing.T, pub crypto.PublicKey) *keyvault.JSONWebKey {
return key
}
func Test_now(t *testing.T) {
t0 := now()
if loc := t0.Location(); loc != time.UTC {
t.Errorf("now() Location = %v, want %v", loc, time.UTC)
}
}
func TestNew(t *testing.T) {
ctrl := gomock.NewController(t)
mockCreateClient(t, ctrl)
@ -439,6 +446,9 @@ func TestKeyVault_CreateSigner(t *testing.T) {
{"fail GetKey", fields{client}, args{&apiv1.CreateSignerRequest{
SigningKey: "azurekms:vault=my-vault;id=not-found;version=my-version",
}}, nil, true},
{"fail SigningKey", fields{client}, args{&apiv1.CreateSignerRequest{
SigningKey: "",
}}, nil, true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {