Ejemplo n.º 1
0
        public void WeCanUseConfigureToSetupTheDefaultClientWithoutAAclToken()
        {
            var address = new Uri("http://localhost:8501");
            var options = new ConsulClusteringOptions();

            //we can configure the default consult client
            options.ConfigureConsulClient(address);

            var client = (ConsulClient)options.CreateClient();

            Assert.Equal(address, client.Config.Address);
            Assert.Null(client.Config.Token);
        }
Ejemplo n.º 2
0
        public void WeCanInjectAConsulClient()
        {
            var fakeConsul = new FakeConsul();
            var options    = new ConsulClusteringOptions();
            Func <IConsulClient> callback = () => fakeConsul;

            //we can inject the consul
            options.ConfigureConsulClient(callback);

            var actual = options.CreateClient();

            Assert.Equal(fakeConsul, actual);
        }
Ejemplo n.º 3
0
 public Task InitializeGatewayListProvider()
 {
     consulClient = options.CreateClient();
     return(Task.CompletedTask);
 }