Skip to content

Commit

Permalink
rpc/apimiddleware: Test all paths can be created (#13073)
Browse files Browse the repository at this point in the history
(cherry picked from commit f592bf7)
  • Loading branch information
prestonvanloon committed Oct 19, 2023
1 parent 05874df commit 747d7b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions beacon-chain/rpc/apimiddleware/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ go_test(
srcs = [
"custom_handlers_test.go",
"custom_hooks_test.go",
"endpoint_factory_test.go",
"structs_marshalling_test.go",
],
embed = [":go_default_library"],
Expand Down
17 changes: 17 additions & 0 deletions beacon-chain/rpc/apimiddleware/endpoint_factory_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package apimiddleware_test

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/apimiddleware"
"github.com/prysmaticlabs/prysm/v4/testing/require"
)

func TestBeaconEndpointFactory_AllPathsRegistered(t *testing.T) {
f := &apimiddleware.BeaconEndpointFactory{}

for _, p := range f.Paths() {
_, err := f.Create(p)
require.NoError(t, err, "failed to register %s", p)
}
}

0 comments on commit 747d7b5

Please sign in to comment.