Skip to content

Commit 88e840d

Browse files
committed
Fix tests
1 parent a1e1bd6 commit 88e840d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

account_test.go

+11-9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import (
2525
"sync"
2626
"testing"
2727
"time"
28+
29+
"go.uber.org/zap"
2830
)
2931

3032
// memoryStorage is an in-memory storage implementation with known contents *and* fixed iteration order for List.
@@ -153,7 +155,7 @@ func (r *recordingStorage) record(name string, args ...interface{}) {
153155
var _ Storage = (*recordingStorage)(nil)
154156

155157
func TestNewAccount(t *testing.T) {
156-
am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)}
158+
am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)}
157159
testConfig := &Config{
158160
Issuers: []Issuer{am},
159161
Storage: &FileStorage{Path: "./_testdata_tmp"},
@@ -181,7 +183,7 @@ func TestNewAccount(t *testing.T) {
181183
func TestSaveAccount(t *testing.T) {
182184
ctx := context.Background()
183185

184-
am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)}
186+
am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)}
185187
testConfig := &Config{
186188
Issuers: []Issuer{am},
187189
Storage: &FileStorage{Path: "./_testdata1_tmp"},
@@ -217,7 +219,7 @@ func TestSaveAccount(t *testing.T) {
217219
func TestGetAccountDoesNotAlreadyExist(t *testing.T) {
218220
ctx := context.Background()
219221

220-
am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)}
222+
am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)}
221223
testConfig := &Config{
222224
Issuers: []Issuer{am},
223225
Storage: &FileStorage{Path: "./_testdata_tmp"},
@@ -239,7 +241,7 @@ func TestGetAccountDoesNotAlreadyExist(t *testing.T) {
239241
func TestGetAccountAlreadyExists(t *testing.T) {
240242
ctx := context.Background()
241243

242-
am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)}
244+
am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)}
243245
testConfig := &Config{
244246
Issuers: []Issuer{am},
245247
Storage: &FileStorage{Path: "./_testdata2_tmp"},
@@ -288,7 +290,7 @@ func TestGetAccountAlreadyExists(t *testing.T) {
288290
func TestGetAccountAlreadyExistsSkipsBroken(t *testing.T) {
289291
ctx := context.Background()
290292

291-
am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)}
293+
am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)}
292294
testConfig := &Config{
293295
Issuers: []Issuer{am},
294296
Storage: &memoryStorage{},
@@ -337,7 +339,7 @@ func TestGetAccountAlreadyExistsSkipsBroken(t *testing.T) {
337339
func TestGetAccountWithEmailAlreadyExists(t *testing.T) {
338340
ctx := context.Background()
339341

340-
am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)}
342+
am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)}
341343
testConfig := &Config{
342344
Issuers: []Issuer{am},
343345
Storage: &recordingStorage{Storage: &memoryStorage{}},
@@ -404,7 +406,7 @@ func TestGetEmailFromPackageDefault(t *testing.T) {
404406
discoveredEmail = ""
405407
}()
406408

407-
am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)}
409+
am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)}
408410
testConfig := &Config{
409411
Issuers: []Issuer{am},
410412
Storage: &FileStorage{Path: "./_testdata2_tmp"},
@@ -426,7 +428,7 @@ func TestGetEmailFromPackageDefault(t *testing.T) {
426428
func TestGetEmailFromUserInput(t *testing.T) {
427429
ctx := context.Background()
428430

429-
am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)}
431+
am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)}
430432
testConfig := &Config{
431433
Issuers: []Issuer{am},
432434
Storage: &FileStorage{Path: "./_testdata3_tmp"},
@@ -461,7 +463,7 @@ func TestGetEmailFromUserInput(t *testing.T) {
461463
func TestGetEmailFromRecent(t *testing.T) {
462464
ctx := context.Background()
463465

464-
am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)}
466+
am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)}
465467
testConfig := &Config{
466468
Issuers: []Issuer{am},
467469
Storage: &FileStorage{Path: "./_testdata4_tmp"},

0 commit comments

Comments
 (0)