"code.cloudfoundry.org/gorouter/metrics/reporter/fakes" "code.cloudfoundry.org/gorouter/proxy" "code.cloudfoundry.org/gorouter/proxy/test_helpers" "code.cloudfoundry.org/gorouter/registry" "code.cloudfoundry.org/gorouter/route" "code.cloudfoundry.org/gorouter/test_util" "code.cloudfoundry.org/lager/lagertest" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" ) var _ = Describe("Proxy Unit tests", func() { var ( proxyObj proxy.Proxy fakeAccessLogger *fakelogger.FakeAccessLogger logger *lagertest.TestLogger ) Context("ServeHTTP", func() { BeforeEach(func() { tlsConfig := &tls.Config{ CipherSuites: conf.CipherSuites, InsecureSkipVerify: conf.SkipSSLValidation, } fakeAccessLogger = &fakelogger.FakeAccessLogger{} logger = lagertest.NewTestLogger("test") r = registry.NewRouteRegistry(logger, conf, new(fakes.FakeRouteRegistryReporter))
"code.cloudfoundry.org/lager" "code.cloudfoundry.org/lager/lagertest" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/urfave/negroni" ) var _ = Describe("AccessLog", func() { var ( handler negroni.Handler logger lager.Logger resp http.ResponseWriter proxyWriter utils.ProxyResponseWriter req *http.Request accessLogger *fakes.FakeAccessLogger extraHeadersToLog []string nextCalled bool ) nextHandler := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { _, err := ioutil.ReadAll(req.Body) Expect(err).NotTo(HaveOccurred()) rw.WriteHeader(http.StatusTeapot) rw.Write([]byte("I'm a little teapot, short and stout.")) nextCalled = true