diff --git a/acme/api/handler_test.go b/acme/api/handler_test.go index 1054de37..00226ad6 100644 --- a/acme/api/handler_test.go +++ b/acme/api/handler_test.go @@ -41,6 +41,7 @@ type mockAcmeAuthority struct { updateAccount func(provisioner.Interface, string, []string) (*acme.Account, error) useNonce func(string) error validateChallenge func(p provisioner.Interface, accID string, id string, jwk *jose.JSONWebKey) (*acme.Challenge, error) + backoffChallenge func(p provisioner.Interface, accID, chID string, jwk *jose.JSONWebKey) (time.Duration, error) ret1 interface{} err error } @@ -203,6 +204,17 @@ func (m *mockAcmeAuthority) ValidateChallenge(p provisioner.Interface, accID str } } +func (m *mockAcmeAuthority) BackoffChallenge(p provisioner.Interface, accID, chID string, jwk *jose.JSONWebKey) (time.Duration, error) { + switch { + case m.backoffChallenge != nil: + return m.backoffChallenge(p, accID, chID, jwk) + case m.err != nil: + return -1, m.err + default: + return m.ret1.(time.Duration), m.err + } +} + func TestHandlerGetNonce(t *testing.T) { tests := []struct { name string