MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / newTestBridgeWithRPC

Function newTestBridgeWithRPC

internal/bridge/mockserver_test.go:331–348  ·  view source on GitHub ↗

--------------------------------------------------------------------------- newTestBridgeWithRPC creates a Bridge connected to a real gRPC client, bypassing NewBridge (which requires mTLS auth files). ---------------------------------------------------------------------------

(t *testing.T, rpcClient listenerrpc.ListenerRPCClient)

Source from the content-addressed store, hash-verified

329// ---------------------------------------------------------------------------
330
331func newTestBridgeWithRPC(t *testing.T, rpcClient listenerrpc.ListenerRPCClient) *Bridge {
332 t.Helper()
333 ctx, cancel := context.WithCancel(context.Background())
334 return &Bridge{
335 cfg: &cfgpkg.C2BridgeConfig{
336 ListenerName: "test-listener",
337 ListenerIP: "127.0.0.1",
338 PipelineName: "test-pipeline",
339 },
340 rpc: rpcClient,
341 listenerID: "test-listener",
342 pipelineID: "test-pipeline",
343 registry: buildDefaultRegistry(),
344 taskManager: NewTaskManager(),
345 ctx: ctx,
346 cancel: cancel,
347 }
348}

Calls 2

buildDefaultRegistryFunction · 0.85
NewTaskManagerFunction · 0.85

Tested by

no test coverage detected