Feature/issue 209 upstream host based routing (#216)

* from messing around at lunch...initial hacking seems to sort of work..need to think of all the test scenarios

* drunken train hacking

* docs for upstreamhost
This commit is contained in:
Tom Pallister
2018-02-02 11:06:54 +00:00
committed by GitHub
parent 86951d6aaa
commit 5848e12d15
13 changed files with 581 additions and 41 deletions

View File

@ -269,6 +269,46 @@ namespace Ocelot.UnitTests.Configuration
.BDDfy();
}
[Fact]
public void configuration_is_valid_with_duplicate_reroutes_all_verbs_but_different_hosts()
{
this.Given(x => x.GivenAConfiguration(new FileConfiguration
{
ReRoutes = new List<FileReRoute>
{
new FileReRoute
{
DownstreamPathTemplate = "/api/products/",
UpstreamPathTemplate = "/asdf/",
DownstreamHostAndPorts = new List<FileHostAndPort>
{
new FileHostAndPort
{
Host = "bb.co.uk"
}
},
UpstreamHost = "host1"
},
new FileReRoute
{
DownstreamPathTemplate = "/www/test/",
UpstreamPathTemplate = "/asdf/",
DownstreamHostAndPorts = new List<FileHostAndPort>
{
new FileHostAndPort
{
Host = "bb.co.uk"
}
},
UpstreamHost = "host1"
}
}
}))
.When(x => x.WhenIValidateTheConfiguration())
.Then(x => x.ThenTheResultIsValid())
.BDDfy();
}
[Fact]
public void configuration_is_not_valid_with_duplicate_reroutes_specific_verbs()
{