MCPcopy Index your code
hub / github.com/zalando/skipper / TestLoopbackStatebag

Function TestLoopbackStatebag

proxy/loopback_test.go:381–406  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

379}
380
381func TestLoopbackStatebag(t *testing.T) {
382 routes := `
383 entry: *
384 -> appendResponseHeader("X-Entry-Route-Done", "true")
385 -> setRequestHeader("X-Loop-Route", "1")
386 -> setState("foo", "bar")
387 -> <loopback>;
388
389 loopRoute1: Header("X-Loop-Route", "1")
390 -> appendResponseHeader("X-Loop-Route-Done", "1")
391 -> setRequestHeader("X-Loop-Route", "2")
392 -> <loopback>;
393
394 loopRoute2: Header("X-Loop-Route", "2")
395 -> appendResponseHeader("X-Loop-Route-Done", "2")
396 -> returnState()
397 -> "$backend";
398 `
399
400 testLoopback(t, routes, Params{}, nil, http.StatusOK, http.Header{
401 "X-Entry-Route-Done": []string{"true"},
402 "X-Loop-Route-Done": []string{"1", "2"},
403 "X-Backend-Done": []string{"true"},
404 "X-State-Bag": []string{"foo=bar"},
405 })
406}
407
408func TestLoopbackWithResponse(t *testing.T) {
409 // create registry

Callers

nothing calls this directly

Calls 1

testLoopbackFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…