MCPcopy Create free account
hub / github.com/erpc/erpc / TestHttpServer_MultipleUpstreams

Function TestHttpServer_MultipleUpstreams

erpc/http_server_test.go:2608–3115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2606 // })
2607}
2608func TestHttpServer_MultipleUpstreams(t *testing.T) {
2609 t.Run("UpstreamNotAllowedByDirectiveViaHeaders", func(t *testing.T) {
2610 cfg := &common.Config{
2611 Server: &common.ServerConfig{
2612 MaxTimeout: common.Duration(10 * time.Second).Ptr(),
2613 },
2614 Projects: []*common.ProjectConfig{
2615 {
2616 Id: "test_project",
2617 Networks: []*common.NetworkConfig{
2618 {
2619 Architecture: common.ArchitectureEvm,
2620 Evm: &common.EvmNetworkConfig{
2621 ChainId: 123,
2622 },
2623 Failsafe: []*common.FailsafeConfig{
2624 {
2625 Retry: nil,
2626 CircuitBreaker: nil,
2627 Hedge: nil,
2628 Timeout: nil,
2629 },
2630 },
2631 },
2632 },
2633 Upstreams: []*common.UpstreamConfig{
2634 {
2635 Id: "rpc1",
2636 Type: common.UpstreamTypeEvm,
2637 Endpoint: "http://rpc1.localhost",
2638 Evm: &common.EvmUpstreamConfig{
2639 ChainId: 123,
2640 },
2641 Failsafe: []*common.FailsafeConfig{
2642 {
2643 Retry: nil,
2644 CircuitBreaker: nil,
2645 Hedge: nil,
2646 Timeout: nil,
2647 },
2648 },
2649 },
2650 {
2651 Id: "rpc2",
2652 Type: common.UpstreamTypeEvm,
2653 Endpoint: "http://rpc2.localhost",
2654 Evm: &common.EvmUpstreamConfig{
2655 ChainId: 123,
2656 },
2657 Failsafe: []*common.FailsafeConfig{
2658 {
2659 Retry: nil,
2660 CircuitBreaker: nil,
2661 Hedge: nil,
2662 Timeout: nil,
2663 },
2664 },
2665 },

Callers

nothing calls this directly

Calls 11

SetDefaultsMethod · 0.95
DurationTypeAlias · 0.92
ResetGockFunction · 0.92
AssertNoPendingMocksFunction · 0.92
SafeReadBodyFunction · 0.92
OverrideAllForTestFunction · 0.92
createServerTestFixturesFunction · 0.85
PtrMethod · 0.80
RunMethod · 0.65
GetProjectMethod · 0.45

Tested by

no test coverage detected