MCPcopy Create free account
hub / github.com/allegro/bigcache / TestServiceLoader

Function TestServiceLoader

server/middleware_test.go:19–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestServiceLoader(t *testing.T) {
20 req, err := http.NewRequest("GET", "/api/v1/stats", nil)
21 if err != nil {
22 t.Error(err)
23 }
24 rr := httptest.NewRecorder()
25 testHandlers := serviceLoader(cacheIndexHandler(), emptyTestHandler())
26 testHandlers.ServeHTTP(rr, req)
27 if status := rr.Code; status != http.StatusAccepted {
28 t.Errorf("handlers not loading properly. want: 202, got: %d", rr.Code)
29 }
30}
31
32func TestRequestMetrics(t *testing.T) {
33 var b bytes.Buffer

Callers

nothing calls this directly

Calls 4

serviceLoaderFunction · 0.85
cacheIndexHandlerFunction · 0.85
emptyTestHandlerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…