aboutsummaryrefslogtreecommitdiff
path: root/middleware/etcd/stub_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-09-07 11:10:16 +0100
committerGravatar GitHub <noreply@github.com> 2016-09-07 11:10:16 +0100
commitd1f17fa7e061d91aa0af7e1fb959a68db899c812 (patch)
tree0f828a0e7bd8ca86051a721dae48e8c19a0a2f0e /middleware/etcd/stub_test.go
parent684330fd28f65a7a8d1ad01fb4c6c5db78240f29 (diff)
downloadcoredns-d1f17fa7e061d91aa0af7e1fb959a68db899c812.tar.gz
coredns-d1f17fa7e061d91aa0af7e1fb959a68db899c812.tar.zst
coredns-d1f17fa7e061d91aa0af7e1fb959a68db899c812.zip
Cleanup: put middleware helper functions in pkgs (#245)
Move all (almost all) Go files in middleware into their own packages. This makes for better naming and discoverability. Lot of changes elsewhere to make this change. The middleware.State was renamed to request.Request which is better, but still does not cover all use-cases. It was also moved out middleware because it is used by `dnsserver` as well. A pkg/dnsutil packages was added for shared, handy, dns util functions. All normalize functions are now put in normalize.go
Diffstat (limited to 'middleware/etcd/stub_test.go')
-rw-r--r--middleware/etcd/stub_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/middleware/etcd/stub_test.go b/middleware/etcd/stub_test.go
index b5a101dad..72a8fb7a0 100644
--- a/middleware/etcd/stub_test.go
+++ b/middleware/etcd/stub_test.go
@@ -8,8 +8,8 @@ import (
"strconv"
"testing"
- "github.com/miekg/coredns/middleware"
"github.com/miekg/coredns/middleware/etcd/msg"
+ "github.com/miekg/coredns/middleware/pkg/dnsrecorder"
"github.com/miekg/coredns/middleware/test"
"github.com/miekg/dns"
@@ -53,7 +53,7 @@ func TestStubLookup(t *testing.T) {
for _, tc := range dnsTestCasesStub {
m := tc.Msg()
- rec := middleware.NewResponseRecorder(&test.ResponseWriter{})
+ rec := dnsrecorder.New(&test.ResponseWriter{})
_, err := etc.ServeDNS(ctxt, rec, m)
if err != nil && m.Question[0].Name == "example.org." {
// This is OK, we expect this backend to *not* work.
@@ -62,12 +62,11 @@ func TestStubLookup(t *testing.T) {
if err != nil {
t.Errorf("expected no error, got %v for %s\n", err, m.Question[0].Name)
}
- resp := rec.Msg()
+ resp := rec.Msg
if resp == nil {
// etcd not running?
continue
}
-
sort.Sort(test.RRSet(resp.Answer))
sort.Sort(test.RRSet(resp.Ns))
sort.Sort(test.RRSet(resp.Extra))