Skip to content

Instantly share code, notes, and snippets.

@agnaite
Created July 3, 2019 21:54
Show Gist options
  • Save agnaite/45c954f5be5a9b93a5a9f2f34508f6a5 to your computer and use it in GitHub Desktop.
Save agnaite/45c954f5be5a9b93a5a9f2f34508f6a5 to your computer and use it in GitHub Desktop.
package checker
import (
"fmt"
"testing"
"github.com/heroku/runtime/acm/domain"
"github.com/heroku/runtime/lib/testlog"
"github.com/heroku/x/go-kit/metrics/provider/discard"
)
func TestNoopValidator(t *testing.T) {
logger, _ := testlog.NewNullLogger()
results := []Result{
Result{Domain: "test.com", Reason: "I am a valid Reason"},
}
n := &NoopValidator{
Logger: logger,
MetricsProvider: discard.New(),
Prefix: "caa-checker",
Checker: &mockValidator{Results: results},
}
r := n.Check([]domain.Domain{})
fmt.Printf("%+v ", r)
}
type mockValidator struct {
Results []Result
}
func (m *mockValidator) Check(domains []domain.Domain) Results {
return m.Results
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment