aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--handler_test.go23
1 files changed, 3 insertions, 20 deletions
diff --git a/handler_test.go b/handler_test.go
index 4496b15..cb11a07 100644
--- a/handler_test.go
+++ b/handler_test.go
@@ -11,7 +11,6 @@ import (
"crypto/ed25519"
"crypto/tls"
- "crypto/x509"
"encoding/base64"
"encoding/json"
"net/http"
@@ -32,30 +31,15 @@ type testHandler struct {
}
func newTestHandler(t *testing.T, signer crypto.Signer) *testHandler {
- anchorList, err := x509util.NewCertificateList(testdata.PemAnchors)
- if err != nil {
- t.Fatalf("failed parsing trust anchors: %v", err)
- }
ctrl := gomock.NewController(t)
client := mockclient.NewMockTrillianLogClient(ctrl)
return &testHandler{
mockCtrl: ctrl,
client: client,
instance: &Instance{
- Deadline: time.Second * 10, // TODO: fix me?
- Client: client,
- LogParameters: &LogParameters{
- LogId: make([]byte, 32),
- TreeId: 0,
- Prefix: "/test",
- MaxRange: 3,
- MaxChain: 3,
- AnchorPool: x509util.NewCertPool(anchorList),
- AnchorList: anchorList,
- KeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageAny},
- Signer: signer,
- HashType: crypto.SHA256,
- },
+ Deadline: time.Second * 10,
+ Client: client,
+ LogParameters: makeTestLogParameters(t, signer),
},
}
}
@@ -155,7 +139,6 @@ func TestGetAnchors(t *testing.T) {
t.Errorf("failed unmarshaling trust anchors response: %v", err)
return
}
- // TODO: add an additional root so that it is an actual list
if got, want := len(derAnchors), len(th.instance.LogParameters.AnchorList); got != want {
t.Errorf("unexpected trust anchor count %d, want %d", got, want)
}