diff --git a/service/http_test.go b/service/http_test.go index 76a4e73da..5abc50261 100644 --- a/service/http_test.go +++ b/service/http_test.go @@ -14,7 +14,7 @@ var _ = Describe("Service HTTP", func() { Describe("HTTPInfo", func() { It("returns the expected router", func() { endpoints := EndpointsFromAddrs("proto", []string{":1", "localhost:2"}) - sut := HTTPInfo{Info{"name", endpoints}, chi.NewMux()} + sut := NewHTTPInfo("name", endpoints) Expect(sut.ServiceName()).Should(Equal("name")) Expect(sut.ExposeOn()).Should(Equal(endpoints)) @@ -105,20 +105,9 @@ var _ = Describe("Service HTTP", func() { }) }) -type fakeHTTPService struct { - HTTPInfo -} - -func newFakeHTTPService(name string, addrs ...string) *fakeHTTPService { - mux := chi.NewMux() - mux.Get("/"+name, nil) - - return &fakeHTTPService{HTTPInfo{ - Info: Info{Name: name, Endpoints: EndpointsFromAddrs("http", addrs)}, - Mux: mux, - }} -} +func newFakeHTTPService(name string, addrs ...string) HTTPService { + svc := NewSimpleHTTP(name, EndpointsFromAddrs("http", addrs)) + svc.Router().Get("/"+name, nil) -func (s *fakeHTTPService) Merge(other Service) (Merger, error) { - return MergeHTTP(s, other) + return &svc } diff --git a/service/service_test.go b/service/service_test.go index a77a52a83..208353eb6 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -10,7 +10,7 @@ var _ = Describe("Service", func() { Describe("Info", func() { endpoints := EndpointsFromAddrs("proto", []string{":1", "localhost:2"}) - sut := Info{"name", endpoints} + sut := NewInfo("name", endpoints) It("implements Service", func() { var svc Service = &sut