(t *testing.T)
| 379 | } |
| 380 | |
| 381 | func 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 | |
| 408 | func TestLoopbackWithResponse(t *testing.T) { |
| 409 | // create registry |
nothing calls this directly
no test coverage detected
searching dependent graphs…