mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 19:58:14 +08:00
@ -53,6 +53,7 @@
|
||||
[Fact]
|
||||
public void should_return_internal_server_error_if_downstream_service_returns_internal_server_error()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -68,7 +69,7 @@
|
||||
new FileHostAndPort
|
||||
{
|
||||
Host = "localhost",
|
||||
Port = 53876,
|
||||
Port = port,
|
||||
}
|
||||
},
|
||||
DownstreamScheme = "http",
|
||||
@ -76,7 +77,7 @@
|
||||
}
|
||||
};
|
||||
|
||||
this.Given(x => x.GivenThereIsAServiceRunningOn("http://localhost:53876"))
|
||||
this.Given(x => x.GivenThereIsAServiceRunningOn($"http://localhost:{port}"))
|
||||
.And(x => _steps.GivenThereIsAConfiguration(configuration))
|
||||
.And(x => _steps.GivenOcelotIsRunning())
|
||||
.When(x => _steps.WhenIGetUrlOnTheApiGateway("/"))
|
||||
@ -87,6 +88,8 @@
|
||||
[Fact]
|
||||
public void should_log_warning_if_downstream_service_returns_internal_server_error()
|
||||
{
|
||||
var port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
ReRoutes = new List<FileReRoute>
|
||||
@ -101,7 +104,7 @@
|
||||
new FileHostAndPort
|
||||
{
|
||||
Host = "localhost",
|
||||
Port = 53876,
|
||||
Port = port,
|
||||
},
|
||||
},
|
||||
DownstreamScheme = "http",
|
||||
@ -109,7 +112,7 @@
|
||||
},
|
||||
};
|
||||
|
||||
this.Given(x => x.GivenThereIsAServiceRunningOn("http://localhost:53876"))
|
||||
this.Given(x => x.GivenThereIsAServiceRunningOn($"http://localhost:{port}"))
|
||||
.And(x => _steps.GivenThereIsAConfiguration(configuration))
|
||||
.And(x => _steps.GivenOcelotIsRunningWithLogger())
|
||||
.When(x => _steps.WhenIGetUrlOnTheApiGateway("/"))
|
||||
|
Reference in New Issue
Block a user