Fixed issue where qos was being created for each request so circuit breaker was never stopping traffic going to downstream service.

This commit is contained in:
TomPallister
2017-02-11 18:56:36 +00:00
parent 820673dda8
commit 286c7f8488
30 changed files with 819 additions and 184 deletions

View File

@ -13,6 +13,7 @@ using Ocelot.Logging;
using Ocelot.QueryStrings.Middleware;
using Ocelot.Requester;
using Ocelot.Requester.Middleware;
using Ocelot.Requester.QoS;
using Ocelot.Responder;
using Ocelot.Responses;
using TestStack.BDDfy;
@ -61,7 +62,7 @@ namespace Ocelot.UnitTests.Requester
[Fact]
public void should_call_scoped_data_repository_correctly()
{
this.Given(x => x.GivenTheRequestIs(new Ocelot.Request.Request(new HttpRequestMessage(),new CookieContainer(),true, new Ocelot.Configuration.QoSOptions(3, 8, 5000, Polly.Timeout.TimeoutStrategy.Pessimistic))))
this.Given(x => x.GivenTheRequestIs(new Ocelot.Request.Request(new HttpRequestMessage(),new CookieContainer(),true, new NoQoSProvider())))
.And(x => x.GivenTheRequesterReturns(new HttpResponseMessage()))
.And(x => x.GivenTheScopedRepoReturns())
.When(x => x.WhenICallTheMiddleware())