mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 22:08:17 +08:00
tweaks
This commit is contained in:
@ -41,9 +41,9 @@ namespace Ocelot.AcceptanceTests
|
||||
int port2 = RandomPortFinder.GetRandomPort();
|
||||
var configuration = new FileConfiguration()
|
||||
{
|
||||
ReRoutes = new List<FileReRoute>()
|
||||
Routes = new List<FileRoute>()
|
||||
{
|
||||
new FileReRoute()
|
||||
new FileRoute()
|
||||
{
|
||||
DownstreamPathTemplate = "/api/values",
|
||||
DownstreamScheme = "http",
|
||||
@ -62,7 +62,7 @@ namespace Ocelot.AcceptanceTests
|
||||
UseTracing = true
|
||||
}
|
||||
},
|
||||
new FileReRoute()
|
||||
new FileRoute()
|
||||
{
|
||||
DownstreamPathTemplate = "/api/values",
|
||||
DownstreamScheme = "http",
|
||||
@ -100,13 +100,8 @@ namespace Ocelot.AcceptanceTests
|
||||
.When(_ => _steps.WhenIGetUrlOnTheApiGateway("/api002/values"))
|
||||
.Then(_ => _steps.ThenTheStatusCodeShouldBe(HttpStatusCode.OK))
|
||||
.And(_ => _steps.ThenTheResponseBodyShouldBe("Hello from Tom"))
|
||||
.And(_ => ThenTheTracerIsCalled(fakeTracer))
|
||||
.BDDfy();
|
||||
|
||||
var commandOnAllStateMachines = Wait.WaitFor(10000).Until(() => fakeTracer.BuildSpanCalled >= 2);
|
||||
|
||||
_output.WriteLine($"fakeTracer.BuildSpanCalled is {fakeTracer.BuildSpanCalled}");
|
||||
|
||||
commandOnAllStateMachines.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -115,9 +110,9 @@ namespace Ocelot.AcceptanceTests
|
||||
int port = RandomPortFinder.GetRandomPort();
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
ReRoutes = new List<FileReRoute>
|
||||
Routes = new List<FileRoute>
|
||||
{
|
||||
new FileReRoute
|
||||
new FileRoute
|
||||
{
|
||||
DownstreamPathTemplate = "/api/values",
|
||||
DownstreamScheme = "http",
|
||||
@ -145,6 +140,7 @@ namespace Ocelot.AcceptanceTests
|
||||
};
|
||||
|
||||
var butterflyPort = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var butterflyUrl = $"http://localhost:{butterflyPort}";
|
||||
|
||||
var fakeTracer = new FakeTracer();
|
||||
@ -161,6 +157,15 @@ namespace Ocelot.AcceptanceTests
|
||||
.BDDfy();
|
||||
}
|
||||
|
||||
private void ThenTheTracerIsCalled(FakeTracer fakeTracer)
|
||||
{
|
||||
var commandOnAllStateMachines = Wait.WaitFor(10000).Until(() => fakeTracer.BuildSpanCalled >= 2);
|
||||
|
||||
_output.WriteLine($"fakeTracer.BuildSpanCalled is {fakeTracer.BuildSpanCalled}");
|
||||
|
||||
commandOnAllStateMachines.ShouldBeTrue();
|
||||
}
|
||||
|
||||
private void GivenServiceOneIsRunning(string baseUrl, string basePath, int statusCode, string responseBody, string butterflyUrl)
|
||||
{
|
||||
_serviceOneBuilder = new WebHostBuilder()
|
||||
|
Reference in New Issue
Block a user