mirror of
https://github.com/hanzoai/grpc-web.git
synced 2026-10-30 18:35:37 +00:00
Per the standing fork rule, a hanzoai fork declares its OWN module path and is required directly -- never resolved via a `replace` against the upstream path. Keeping the upstream path meant every consumer's import line carried the upstream brand. module github.com/traefik/grpc-web -> module github.com/hanzoai/grpc-web All occurrences were import paths (package self-imports plus the test servers and the react example server). go/grpcweb -- the package Hanzo Ingress links -- is green.
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
// Copyright 2017 Improbable. All Rights Reserved.
|
|
// See LICENSE for licensing terms.
|
|
|
|
package grpcweb_test
|
|
|
|
import (
|
|
"sort"
|
|
"testing"
|
|
|
|
testproto "github.com/hanzoai/grpc-web/integration_test/go/_proto/improbable/grpcweb/test"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/hanzoai/grpc-web/go/grpcweb"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
func TestListGRPCResources(t *testing.T) {
|
|
server := grpc.NewServer()
|
|
testproto.RegisterTestServiceServer(server, &testServiceImpl{})
|
|
expected := []string{
|
|
"/improbable.grpcweb.test.TestService/PingEmpty",
|
|
"/improbable.grpcweb.test.TestService/Ping",
|
|
"/improbable.grpcweb.test.TestService/PingError",
|
|
"/improbable.grpcweb.test.TestService/PingList",
|
|
"/improbable.grpcweb.test.TestService/Echo",
|
|
"/improbable.grpcweb.test.TestService/PingPongBidi",
|
|
"/improbable.grpcweb.test.TestService/PingStream",
|
|
}
|
|
actual := grpcweb.ListGRPCResources(server)
|
|
sort.Strings(expected)
|
|
sort.Strings(actual)
|
|
assert.EqualValues(t,
|
|
expected,
|
|
actual,
|
|
"list grpc resources must provide an exhaustive list of all registered handlers")
|
|
}
|