Feature/issue with path and query string #458 (#565)

* #548 added failing test

* #548 fixed failing tests for issue where using /{everything} didnt build path correctly
This commit is contained in:
Tom Pallister
2018-08-20 22:28:58 +01:00
committed by GitHub
parent 7e01caf550
commit 00a600064d
5 changed files with 616 additions and 509 deletions

View File

@ -915,6 +915,41 @@ namespace Ocelot.AcceptanceTests
.BDDfy();
}
[Fact]
public void should_match_multiple_paths_with_catch_all()
{
var port = 61999;
var configuration = new FileConfiguration
{
ReRoutes = new List<FileReRoute>
{
new FileReRoute
{
DownstreamPathTemplate = "/{everything}",
DownstreamScheme = "http",
UpstreamPathTemplate = "/{everything}",
UpstreamHttpMethod = new List<string> { "Get" },
DownstreamHostAndPorts = new List<FileHostAndPort>
{
new FileHostAndPort
{
Host = "localhost",
Port = port,
}
},
}
}
};
this.Given(x => x.GivenThereIsAServiceRunningOn($"http://localhost:{port}/", "/test/toot", 200, "Hello from Laura"))
.And(x => _steps.GivenThereIsAConfiguration(configuration))
.And(x => _steps.GivenOcelotIsRunning())
.When(x => _steps.WhenIGetUrlOnTheApiGateway("/test/toot"))
.Then(x => _steps.ThenTheStatusCodeShouldBe(HttpStatusCode.OK))
.And(x => _steps.ThenTheResponseBodyShouldBe("Hello from Laura"))
.BDDfy();
}
[Fact]
public void should_fix_issue_271()
{