mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 19:50:49 +08:00 
			
		
		
		
	Upgrade Pivotal.Discovery.Client to Pivotal.Discovery.ClientCore (#369)
This commit is contained in:
		
				
					committed by
					
						
						Tom Pallister
					
				
			
			
				
	
			
			
			
						parent
						
							d01720c349
						
					
				
				
					commit
					32a258fd3f
				
			@@ -7,6 +7,8 @@ namespace Ocelot.UnitTests.Middleware
 | 
			
		||||
    using Ocelot.Middleware.Pipeline;
 | 
			
		||||
    using Pivotal.Discovery.Client;
 | 
			
		||||
    using Shouldly;
 | 
			
		||||
    using Steeltoe.Common.Discovery;
 | 
			
		||||
    using Steeltoe.Discovery.Eureka;
 | 
			
		||||
    using TestStack.BDDfy;
 | 
			
		||||
    using Xunit;
 | 
			
		||||
 | 
			
		||||
@@ -40,7 +42,16 @@ namespace Ocelot.UnitTests.Middleware
 | 
			
		||||
            var root = test.Build();
 | 
			
		||||
            var services = new ServiceCollection();
 | 
			
		||||
            services.AddSingleton<IConfiguration>(root);
 | 
			
		||||
            services.AddDiscoveryClient(new DiscoveryOptions {ClientType = DiscoveryClientType.EUREKA});
 | 
			
		||||
            services.AddDiscoveryClient(new DiscoveryOptions 
 | 
			
		||||
            {
 | 
			
		||||
                ClientType = DiscoveryClientType.EUREKA,
 | 
			
		||||
                //options can not be null
 | 
			
		||||
                ClientOptions = new EurekaClientOptions()
 | 
			
		||||
                {
 | 
			
		||||
                    ShouldFetchRegistry = false,
 | 
			
		||||
                    ShouldRegisterWithEureka = false
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
            services.AddOcelot();
 | 
			
		||||
            var provider = services.BuildServiceProvider();
 | 
			
		||||
            _builder = new OcelotPipelineBuilder(provider);
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@
 | 
			
		||||
    using Ocelot.ServiceDiscovery.Providers;
 | 
			
		||||
    using Pivotal.Discovery.Client;
 | 
			
		||||
    using Shouldly;
 | 
			
		||||
    using Steeltoe.Common.Discovery;
 | 
			
		||||
    using TestStack.BDDfy;
 | 
			
		||||
    using Values;
 | 
			
		||||
    using Xunit;
 | 
			
		||||
 
 | 
			
		||||
@@ -13,8 +13,9 @@ using Xunit;
 | 
			
		||||
 | 
			
		||||
namespace Ocelot.UnitTests.ServiceDiscovery
 | 
			
		||||
{
 | 
			
		||||
    using Pivotal.Discovery.Client;
 | 
			
		||||
 | 
			
		||||
    using Pivotal.Discovery.Client;
 | 
			
		||||
    using Steeltoe.Common.Discovery;
 | 
			
		||||
 | 
			
		||||
    public class ServiceProviderFactoryTests
 | 
			
		||||
    {
 | 
			
		||||
        private ServiceProviderConfiguration _serviceConfig;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user