mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-08-04 22:52:26 +08:00
#1115 find available ports to use in acceptance tests
This commit is contained in:
@ -20,7 +20,7 @@ namespace Ocelot.AcceptanceTests
|
||||
{
|
||||
private readonly Steps _steps;
|
||||
private IWebHost _identityServerBuilder;
|
||||
private string _identityServerRootUrl = "http://localhost:51888";
|
||||
private string _identityServerRootUrl;
|
||||
private string _downstreamServicePath = "/";
|
||||
private string _downstreamServiceHost = "localhost";
|
||||
private string _downstreamServiceScheme = "http";
|
||||
@ -31,7 +31,9 @@ namespace Ocelot.AcceptanceTests
|
||||
public AuthenticationTests()
|
||||
{
|
||||
_serviceHandler = new ServiceHandler();
|
||||
_steps = new Steps();
|
||||
_steps = new Steps();
|
||||
var identityServerPort = RandomPortFinder.GetRandomPort();
|
||||
_identityServerRootUrl = $"http://localhost:{identityServerPort}";
|
||||
_options = o =>
|
||||
{
|
||||
o.Authority = _identityServerRootUrl;
|
||||
@ -45,7 +47,7 @@ namespace Ocelot.AcceptanceTests
|
||||
[Fact]
|
||||
public void should_return_401_using_identity_server_access_token()
|
||||
{
|
||||
int port = 54329;
|
||||
int port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -86,7 +88,7 @@ namespace Ocelot.AcceptanceTests
|
||||
[Fact]
|
||||
public void should_return_response_200_using_identity_server()
|
||||
{
|
||||
int port = 54099;
|
||||
int port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -129,7 +131,7 @@ namespace Ocelot.AcceptanceTests
|
||||
[Fact]
|
||||
public void should_return_response_401_using_identity_server_with_token_requested_for_other_api()
|
||||
{
|
||||
int port = 54196;
|
||||
int port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -171,7 +173,7 @@ namespace Ocelot.AcceptanceTests
|
||||
[Fact]
|
||||
public void should_return_201_using_identity_server_access_token()
|
||||
{
|
||||
int port = 52226;
|
||||
int port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
@ -214,7 +216,7 @@ namespace Ocelot.AcceptanceTests
|
||||
[Fact]
|
||||
public void should_return_201_using_identity_server_reference_token()
|
||||
{
|
||||
int port = 52222;
|
||||
int port = RandomPortFinder.GetRandomPort();
|
||||
|
||||
var configuration = new FileConfiguration
|
||||
{
|
||||
|
Reference in New Issue
Block a user