Feature/fix admin api caching wrong re routes (#421)

* #383 added failing test for this issue

* #383 identified issue was with cached load balancer for a given upstream path template based on the key we use, have modified this to include more data, I guess this might be an issue again for other things so I will have a think about it

* #383 fixed failing tests after key change

* Seems to be an issue with coveralls new package not being on nuget...try same version as their nuget package

* bash the old manual tests json back in
This commit is contained in:
Tom Pallister
2018-06-21 22:45:24 +01:00
committed by GitHub
parent fffc4c8d3c
commit 3eb9b4da89
8 changed files with 1903 additions and 1731 deletions

View File

@ -199,7 +199,7 @@
.WithDownstreamScheme("http")
.WithUpstreamHttpMethod(new List<string>() {"Get"})
.WithDownstreamAddresses(new List<DownstreamHostAndPort>() {new DownstreamHostAndPort("localhost", 51878)})
.WithLoadBalancerKey("/laura|Get")
.WithLoadBalancerKey("/laura|Get|localhost:51878")
.Build();
var lauraReRoute = new ReRouteBuilder()
@ -218,7 +218,7 @@
.WithDownstreamScheme("http")
.WithUpstreamHttpMethod(new List<string>() { "Get" })
.WithDownstreamAddresses(new List<DownstreamHostAndPort>() { new DownstreamHostAndPort("localhost", 51878) })
.WithLoadBalancerKey("/tom|Get")
.WithLoadBalancerKey("/tom|Get|localhost:51880")
.Build();
var tomReRoute = new ReRouteBuilder()
@ -409,7 +409,7 @@
.WithDownstreamPathTemplate("/products/{productId}")
.WithUpstreamPathTemplate("/api/products/{productId}")
.WithUpstreamHttpMethod(new List<string> {"Get"})
.WithLoadBalancerKey("/api/products/{productId}|Get")
.WithLoadBalancerKey("/api/products/{productId}|Get|127.0.0.1:0")
.Build();
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
@ -461,7 +461,7 @@
.WithUpstreamPathTemplate("/api/products/{productId}")
.WithUpstreamHttpMethod(new List<string> {"Get"})
.WithDelegatingHandlers(handlers)
.WithLoadBalancerKey("/api/products/{productId}|Get")
.WithLoadBalancerKey("/api/products/{productId}|Get|")
.Build();
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
@ -506,7 +506,7 @@
.WithUpstreamHttpMethod(new List<string> {"Get"})
.WithUseServiceDiscovery(true)
.WithServiceName("ProductService")
.WithLoadBalancerKey("/api/products/{productId}|Get")
.WithLoadBalancerKey("/api/products/{productId}|Get|")
.Build();
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
@ -557,7 +557,7 @@
.WithUpstreamPathTemplate("/api/products/{productId}")
.WithUpstreamHttpMethod(new List<string> {"Get"})
.WithUseServiceDiscovery(false)
.WithLoadBalancerKey("/api/products/{productId}|Get")
.WithLoadBalancerKey("/api/products/{productId}|Get|")
.Build();
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
@ -600,7 +600,7 @@
.WithUpstreamPathTemplate("/api/products/{productId}")
.WithUpstreamHttpMethod(new List<string> {"Get"})
.WithUpstreamTemplatePattern(new UpstreamPathTemplate("(?i)/api/products/.*/$", 1))
.WithLoadBalancerKey("/api/products/{productId}|Get")
.WithLoadBalancerKey("/api/products/{productId}|Get|")
.Build();
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
@ -645,7 +645,7 @@
.WithUpstreamPathTemplate("/api/products/{productId}")
.WithUpstreamHttpMethod(new List<string> {"Get"})
.WithRequestIdKey("blahhhh")
.WithLoadBalancerKey("/api/products/{productId}|Get")
.WithLoadBalancerKey("/api/products/{productId}|Get|")
.Build();
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
@ -740,7 +740,7 @@
{
new ClaimToThing("CustomerId", "CustomerId", "", 0),
})
.WithLoadBalancerKey("/api/products/{productId}|Get")
.WithLoadBalancerKey("/api/products/{productId}|Get|")
.Build();
var expected = new List<ReRoute>
@ -783,7 +783,7 @@
.WithUpstreamPathTemplate("/api/products/{productId}")
.WithUpstreamHttpMethod(new List<string> {"Get"})
.WithAuthenticationOptions(authenticationOptions)
.WithLoadBalancerKey("/api/products/{productId}|Get")
.WithLoadBalancerKey("/api/products/{productId}|Get|")
.Build();
var expected = new List<ReRoute>