You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
747 B
Go
38 lines
747 B
Go
3 years ago
|
package internal
|
||
4 years ago
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"google.golang.org/grpc/resolver"
|
||
|
"google.golang.org/grpc/serviceconfig"
|
||
|
)
|
||
|
|
||
|
func TestNopResolver(t *testing.T) {
|
||
|
// make sure ResolveNow & Close don't panic
|
||
|
var r nopResolver
|
||
|
r.ResolveNow(resolver.ResolveNowOptions{})
|
||
|
r.Close()
|
||
|
}
|
||
|
|
||
|
type mockedClientConn struct {
|
||
|
state resolver.State
|
||
|
}
|
||
|
|
||
3 years ago
|
func (m *mockedClientConn) UpdateState(state resolver.State) error {
|
||
4 years ago
|
m.state = state
|
||
3 years ago
|
return nil
|
||
4 years ago
|
}
|
||
|
|
||
|
func (m *mockedClientConn) ReportError(err error) {
|
||
|
}
|
||
|
|
||
|
func (m *mockedClientConn) NewAddress(addresses []resolver.Address) {
|
||
|
}
|
||
|
|
||
|
func (m *mockedClientConn) NewServiceConfig(serviceConfig string) {
|
||
|
}
|
||
|
|
||
|
func (m *mockedClientConn) ParseServiceConfig(serviceConfigJSON string) *serviceconfig.ParseResult {
|
||
|
return nil
|
||
|
}
|