MCPcopy
hub / github.com/vulcand/vulcand / TestFrontendUpdateRoute

Method TestFrontendUpdateRoute

proxy/mux/mux_test.go:674–696  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

672}
673
674func (s *ServerSuite) TestFrontendUpdateRoute(c *C) {
675 e := testutils.NewResponder("hola")
676 defer e.Close()
677
678 b := MakeBatch(Batch{
679 Addr: "localhost:31000",
680 Route: `Path("/")`,
681 URL: e.URL,
682 })
683 c.Assert(s.mux.Init(b.Snapshot()), IsNil)
684 c.Assert(s.mux.Start(), IsNil)
685
686 c.Assert(GETResponse(c, b.FrontendURL("/")), Equals, "hola")
687
688 b.F.Route = `Path("/New")`
689
690 c.Assert(s.mux.UpsertFrontend(b.F), IsNil)
691 c.Assert(GETResponse(c, b.FrontendURL("/New")), Equals, "hola")
692
693 response, _, err := testutils.Get(MakeURL(b.L, "/"))
694 c.Assert(err, IsNil)
695 c.Assert(response.StatusCode, Equals, http.StatusNotFound)
696}
697
698func (s *ServerSuite) TestFrontendRestoreRoute(c *C) {
699 e := testutils.NewResponder("onestraw")

Callers

nothing calls this directly

Calls 10

MakeBatchFunction · 0.85
MakeURLFunction · 0.85
FrontendURLMethod · 0.80
GETResponseFunction · 0.70
CloseMethod · 0.65
InitMethod · 0.65
StartMethod · 0.65
UpsertFrontendMethod · 0.65
SnapshotMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected