Feature/extra request id test (#329)

* messing around with benchmark.net.seems Ocelot adds about 2ms to a request..lets make this less? :)

* #326 store json indented so it looks nice :P

* #327 show another test how request id works
This commit is contained in:
Tom Pallister 2018-04-24 08:30:45 +01:00 committed by GitHub
parent 77211e9f16
commit fad190fcae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,6 +132,43 @@ namespace Ocelot.AcceptanceTests
.BDDfy(); .BDDfy();
} }
[Fact]
public void should_use_global_request_id_create_and_forward()
{
var configuration = new FileConfiguration
{
ReRoutes = new List<FileReRoute>
{
new FileReRoute
{
DownstreamPathTemplate = "/",
DownstreamHostAndPorts = new List<FileHostAndPort>
{
new FileHostAndPort
{
Host = "localhost",
Port = 51873,
}
},
DownstreamScheme = "http",
UpstreamPathTemplate = "/",
UpstreamHttpMethod = new List<string> { "Get" },
}
},
GlobalConfiguration = new FileGlobalConfiguration
{
RequestIdKey = _steps.RequestIdKey
}
};
this.Given(x => x.GivenThereIsAServiceRunningOn("http://localhost:51873"))
.And(x => _steps.GivenThereIsAConfiguration(configuration))
.And(x => _steps.GivenOcelotIsRunning())
.When(x => _steps.WhenIGetUrlOnTheApiGateway("/"))
.Then(x => _steps.ThenTheRequestIdIsReturned())
.BDDfy();
}
private void GivenThereIsAServiceRunningOn(string url) private void GivenThereIsAServiceRunningOn(string url)
{ {
_builder = new WebHostBuilder() _builder = new WebHostBuilder()