@Test
public void serviceOnDisconnectedTest() {

  final GrpcServiceConfig[] requestCaptor = new GrpcServiceConfig[1];
  TccEventServiceImplBase serviceImpl = new TccEventServiceImplBase() {
    public void onDisconnected(GrpcServiceConfig request, StreamObserver<GrpcAck> responseObserver) {
      requestCaptor[0] = request;
      responseObserver.onNext(ack);
      responseObserver.onCompleted();
    }
  };
  serviceRegistry.addService(serviceImpl);
  service.onDisconnected();
  assertThat(requestCaptor[0].getServiceName(), is(serviceConfig.serviceName()));
  assertThat(requestCaptor[0].getInstanceId(), is(serviceConfig.instanceId()));
}