Skip to content

Commit

Permalink
Feature/extra request id test (#329)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
TomPallister authored Apr 24, 2018
1 parent 77211e9 commit fad190f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/Ocelot.AcceptanceTests/RequestIdTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,43 @@ public void should_use_global_request_id_and_forward()
.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)
{
_builder = new WebHostBuilder()
Expand Down

0 comments on commit fad190f

Please sign in to comment.