(t *testing.T, handshakerServiceAddress string)
| 481 | } |
| 482 | |
| 483 | func startServer(t *testing.T, handshakerServiceAddress string) (stop func(), address string) { |
| 484 | listener, err := testutils.LocalTCPListener() |
| 485 | if err != nil { |
| 486 | t.Fatalf("LocalTCPListener() failed: %v", err) |
| 487 | } |
| 488 | serverOpts := &ServerOptions{HandshakerServiceAddress: handshakerServiceAddress} |
| 489 | creds := NewServerCreds(serverOpts) |
| 490 | stub := &stubserver.StubServer{ |
| 491 | Listener: listener, |
| 492 | UnaryCallF: func(context.Context, *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { |
| 493 | return &testpb.SimpleResponse{ |
| 494 | Payload: &testpb.Payload{}, |
| 495 | }, nil |
| 496 | }, |
| 497 | S: grpc.NewServer(grpc.Creds(creds)), |
| 498 | } |
| 499 | stubserver.StartTestService(t, stub) |
| 500 | return func() { stub.S.Stop() }, listener.Addr().String() |
| 501 | } |
no test coverage detected