test: extract newMockEnvoy helper

This commit is contained in:
Jay
2026-05-17 12:17:29 -04:00
parent 6d6ef22134
commit 55e92dddc3
2 changed files with 15 additions and 10 deletions
+13
View File
@@ -133,3 +133,16 @@ func newMockSessionHarness() *mockSessionHarness {
terminate: terminate,
}
}
// MockEnvoy
func newMockEnvoy(t *testing.T) (*mockPool, *Envoy) {
t.Helper()
p := newMockPool(t)
emb := NewEmbassy(p.ctx, p.plugin, nil)
err := emb.Dispatch(p.url)
assert.NoError(t, err)
envoy := emb.Call(p.url)
return p, envoy
}