public void GetRequestMessage_AddsBasicAuthIfPassword()
        {
            ConfigServerClientSettings settings = new ConfigServerClientSettings();

            settings.Uri         = "http://*****:*****@localhost:8888/";
            settings.Name        = "foo";
            settings.Environment = "development";
            ConfigServerConfigurationProvider provider = new ConfigServerConfigurationProvider(settings);

            string requestURI = provider.GetConfigServerUri(null);
            var    request    = provider.GetRequestMessage(requestURI);

            Assert.Equal(HttpMethod.Get, request.Method);
            Assert.Equal(requestURI, request.RequestUri.ToString());
            Assert.NotNull(request.Headers.Authorization);
            Assert.Equal("Basic", request.Headers.Authorization.Scheme);
            Assert.Equal(provider.GetEncoded("user", "password"), request.Headers.Authorization.Parameter);
        }
        public void GetRequestMessage_AddsVaultToken_IfNeeded()
        {
            ConfigServerClientSettings settings = new ConfigServerClientSettings();

            settings.Uri         = "http://localhost:8888/";
            settings.Name        = "foo";
            settings.Environment = "development";
            settings.Token       = "MyVaultToken";
            ConfigServerConfigurationProvider provider = new ConfigServerConfigurationProvider(settings);

            string requestURI = provider.GetConfigServerUri(null);
            var    request    = provider.GetRequestMessage(requestURI);

            Assert.Equal(HttpMethod.Get, request.Method);
            Assert.Equal(requestURI, request.RequestUri.ToString());
            Assert.True(request.Headers.Contains(ConfigServerConfigurationProvider.TOKEN_HEADER));
            var headerValues = request.Headers.GetValues(ConfigServerConfigurationProvider.TOKEN_HEADER);

            Assert.Contains("MyVaultToken", headerValues);
        }