MCPcopy
hub / github.com/grpc/grpc-go / TestOverrideServerName

Method TestOverrideServerName

credentials/alts/alts_test.go:78–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func (s) TestOverrideServerName(t *testing.T) {
79 wantServerName := "server.name"
80 // This is not testing any handshaker functionality, so it's fine to only
81 // use NewServerCreds and not NewClientCreds.
82 c := NewServerCreds(DefaultServerOptions())
83 c.OverrideServerName(wantServerName)
84 if got, want := c.Info().ServerName, wantServerName; got != want {
85 t.Fatalf("c.Info().ServerName = %v, want %v", got, want)
86 }
87}
88
89func (s) TestCloneClient(t *testing.T) {
90 wantServerName := "server.name"

Callers

nothing calls this directly

Calls 5

DefaultServerOptionsFunction · 0.85
NewServerCredsFunction · 0.70
OverrideServerNameMethod · 0.65
InfoMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected