Upgrade Pivotal.Discovery.Client to Pivotal.Discovery.ClientCore (#369)

This commit is contained in:
Catcher Wong
2018-05-22 14:13:45 +08:00
committed by Tom Pallister
parent d01720c349
commit 32a258fd3f
9 changed files with 25 additions and 11 deletions

View File

@ -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);