forked from adamlaska/boulder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmock_test.go
More file actions
35 lines (29 loc) · 880 Bytes
/
mock_test.go
File metadata and controls
35 lines (29 loc) · 880 Bytes
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
package ra
import (
"context"
"time"
"github.com/letsencrypt/boulder/mocks"
sapb "github.com/letsencrypt/boulder/sa/proto"
)
type mockInvalidAuthorizationsAuthority struct {
mocks.StorageAuthority
domainWithFailures string
}
func (sa *mockInvalidAuthorizationsAuthority) CountOrders(ctx context.Context, _ int64, _ time.Time, _ time.Time) (int, error) {
return 0, nil
}
func (sa *mockInvalidAuthorizationsAuthority) PreviousCertificateExists(
_ context.Context,
_ *sapb.PreviousCertificateExistsRequest,
) (*sapb.Exists, error) {
return &sapb.Exists{
Exists: false,
}, nil
}
func (sa *mockInvalidAuthorizationsAuthority) CountInvalidAuthorizations2(ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest) (*sapb.Count, error) {
if req.Hostname == sa.domainWithFailures {
return &sapb.Count{Count: 1}, nil
} else {
return &sapb.Count{}, nil
}
}