Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jsha committed Dec 20, 2024
1 parent 0d54973 commit 3ee5da4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions wfe2/wfe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3863,13 +3863,17 @@ func Test_sendErrorInternalServerError(t *testing.T) {

// mockSAForARI provides a mock SA with the methods required for an issuance and
// a renewal with the ARI `Replaces` field.
//
// Note that FQDNSetTimestampsForWindow always return an empty list, which allows us to act
// as if a certificate is not getting the renewal exemption, even when we are repeatedly
// issuing for the same names.
type mockSAForARI struct {
sapb.StorageAuthorityReadOnlyClient
cert *corepb.Certificate
}

func (sa *mockSAForARI) FQDNSetExists(ctx context.Context, in *sapb.FQDNSetExistsRequest, opts ...grpc.CallOption) (*sapb.Exists, error) {
return &sapb.Exists{Exists: false}, nil
func (sa *mockSAForARI) FQDNSetTimestampsForWindow(ctx context.Context, in *sapb.CountFQDNSetsRequest, opts ...grpc.CallOption) (*sapb.Timestamps, error) {
return &sapb.Timestamps{Timestamps: nil}, nil
}

// GetCertificate returns the inner certificate if it matches the given serial.
Expand Down Expand Up @@ -4170,6 +4174,9 @@ func TestNewOrderRateLimits(t *testing.T) {
`{"Identifiers": [{"type": "dns", "value": "example.com"}]}`)
responseWriter = httptest.NewRecorder()
mux.ServeHTTP(responseWriter, r)
features.Set(features.Config{
UseKvLimitsForNewOrder: true,
})
test.AssertEquals(t, responseWriter.Code, http.StatusTooManyRequests)

// Make a request with the "Replaces" field, which should satisfy ARI checks
Expand Down

0 comments on commit 3ee5da4

Please sign in to comment.