mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:42:50 +08:00
Remove multiple concurrent blank lines
SA1507
This commit is contained in:
parent
edbed051de
commit
167fbb3daf
@ -123,7 +123,6 @@ namespace Ocelot.Cache.Middleware
|
|||||||
|
|
||||||
var contentHeaders = response?.Content?.Headers.ToDictionary(v => v.Key, v => v.Value);
|
var contentHeaders = response?.Content?.Headers.ToDictionary(v => v.Key, v => v.Value);
|
||||||
|
|
||||||
|
|
||||||
var cached = new CachedResponse(statusCode, headers, body, contentHeaders);
|
var cached = new CachedResponse(statusCode, headers, body, contentHeaders);
|
||||||
return cached;
|
return cached;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,6 @@ namespace Ocelot.Configuration.Builder
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DownstreamReRoute Build()
|
public DownstreamReRoute Build()
|
||||||
{
|
{
|
||||||
return new DownstreamReRoute(
|
return new DownstreamReRoute(
|
||||||
|
@ -35,7 +35,6 @@ namespace Ocelot.Configuration.Creator
|
|||||||
private readonly IHeaderFindAndReplaceCreator _headerFAndRCreator;
|
private readonly IHeaderFindAndReplaceCreator _headerFAndRCreator;
|
||||||
private readonly IDownstreamAddressesCreator _downstreamAddressesCreator;
|
private readonly IDownstreamAddressesCreator _downstreamAddressesCreator;
|
||||||
|
|
||||||
|
|
||||||
public FileOcelotConfigurationCreator(
|
public FileOcelotConfigurationCreator(
|
||||||
IOptions<FileConfiguration> options,
|
IOptions<FileConfiguration> options,
|
||||||
IConfigurationValidator configurationValidator,
|
IConfigurationValidator configurationValidator,
|
||||||
|
@ -67,7 +67,6 @@ namespace Ocelot.Configuration.Creator
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private bool IsPlaceHolder(string upstreamTemplate, int i)
|
private bool IsPlaceHolder(string upstreamTemplate, int i)
|
||||||
{
|
{
|
||||||
return upstreamTemplate[i] == '{';
|
return upstreamTemplate[i] == '{';
|
||||||
|
@ -16,7 +16,6 @@ namespace Ocelot.Configuration
|
|||||||
TimeoutStrategy = timeoutStrategy;
|
TimeoutStrategy = timeoutStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int ExceptionsAllowedBeforeBreaking { get; private set; }
|
public int ExceptionsAllowedBeforeBreaking { get; private set; }
|
||||||
|
|
||||||
public int DurationOfBreak { get; private set; }
|
public int DurationOfBreak { get; private set; }
|
||||||
|
@ -266,7 +266,6 @@ namespace Ocelot.DependencyInjection
|
|||||||
var baseSchemeUrlAndPort = urlFinder.Find();
|
var baseSchemeUrlAndPort = urlFinder.Find();
|
||||||
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
|
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
|
||||||
|
|
||||||
|
|
||||||
_services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme)
|
_services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme)
|
||||||
.AddIdentityServerAuthentication(o =>
|
.AddIdentityServerAuthentication(o =>
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,6 @@ namespace Ocelot.DownstreamRouteFinder.Middleware
|
|||||||
private readonly IOcelotConfigurationProvider _configProvider;
|
private readonly IOcelotConfigurationProvider _configProvider;
|
||||||
private readonly IMultiplexer _multiplexer;
|
private readonly IMultiplexer _multiplexer;
|
||||||
|
|
||||||
|
|
||||||
public DownstreamRouteFinderMiddleware(OcelotRequestDelegate next,
|
public DownstreamRouteFinderMiddleware(OcelotRequestDelegate next,
|
||||||
IOcelotLoggerFactory loggerFactory,
|
IOcelotLoggerFactory loggerFactory,
|
||||||
IDownstreamRouteFinder downstreamRouteFinder,
|
IDownstreamRouteFinder downstreamRouteFinder,
|
||||||
|
@ -25,7 +25,6 @@ namespace Ocelot.DownstreamUrlCreator
|
|||||||
return new ErrorResponse<DownstreamUrl>(new List<Error> { new DownstreamHostNullOrEmptyError() });
|
return new ErrorResponse<DownstreamUrl>(new List<Error> { new DownstreamHostNullOrEmptyError() });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var builder = new UriBuilder
|
var builder = new UriBuilder
|
||||||
{
|
{
|
||||||
Host = downstreamHostAndPort.DownstreamHost,
|
Host = downstreamHostAndPort.DownstreamHost,
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
return new OkResponse<string>(value);
|
return new OkResponse<string>(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Response<List<string>> GetValuesByClaimType(IEnumerable<Claim> claims, string claimType)
|
public Response<List<string>> GetValuesByClaimType(IEnumerable<Claim> claims, string claimType)
|
||||||
{
|
{
|
||||||
List<string> values = new List<string>();
|
List<string> values = new List<string>();
|
||||||
@ -47,7 +46,6 @@
|
|||||||
return new OkResponse<List<string>>(values);
|
return new OkResponse<List<string>>(values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Response<string> GetValue(IEnumerable<Claim> claims, string key)
|
private Response<string> GetValue(IEnumerable<Claim> claims, string key)
|
||||||
{
|
{
|
||||||
var claim = claims.FirstOrDefault(c => c.Type == key);
|
var claim = claims.FirstOrDefault(c => c.Type == key);
|
||||||
|
@ -17,7 +17,6 @@ namespace Ocelot.LoadBalancer.LoadBalancers
|
|||||||
_services = services;
|
_services = services;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<Response<ServiceHostAndPort>> Lease()
|
public async Task<Response<ServiceHostAndPort>> Lease()
|
||||||
{
|
{
|
||||||
var services = await _services.Invoke();
|
var services = await _services.Invoke();
|
||||||
|
@ -23,7 +23,6 @@ namespace Ocelot.RateLimit
|
|||||||
return _core.ProcessRequest(requestIdentity, option);
|
return _core.ProcessRequest(requestIdentity, option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int RetryAfterFrom(DateTime timestamp, RateLimitRule rule)
|
public int RetryAfterFrom(DateTime timestamp, RateLimitRule rule)
|
||||||
{
|
{
|
||||||
return _core.RetryAfterFrom(timestamp, rule);
|
return _core.RetryAfterFrom(timestamp, rule);
|
||||||
|
@ -18,7 +18,6 @@ namespace Ocelot.RequestId.Middleware
|
|||||||
private readonly IOcelotLogger _logger;
|
private readonly IOcelotLogger _logger;
|
||||||
private readonly IRequestScopedDataRepository _requestScopedDataRepository;
|
private readonly IRequestScopedDataRepository _requestScopedDataRepository;
|
||||||
|
|
||||||
|
|
||||||
public ReRouteRequestIdMiddleware(OcelotRequestDelegate next,
|
public ReRouteRequestIdMiddleware(OcelotRequestDelegate next,
|
||||||
IOcelotLoggerFactory loggerFactory,
|
IOcelotLoggerFactory loggerFactory,
|
||||||
IRequestScopedDataRepository requestScopedDataRepository)
|
IRequestScopedDataRepository requestScopedDataRepository)
|
||||||
|
@ -229,7 +229,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_be_thread_safe()
|
public void should_be_thread_safe()
|
||||||
{
|
{
|
||||||
|
@ -104,7 +104,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.And(x => _steps.ThenTheResponseBodyShouldBe("Hello from Tom"))
|
.And(x => _steps.ThenTheResponseBodyShouldBe("Hello from Tom"))
|
||||||
.BDDfy();
|
.BDDfy();
|
||||||
|
|
||||||
|
|
||||||
var commandOnAllStateMachines = WaitFor(5000).Until(() => _butterflyCalled == 4);
|
var commandOnAllStateMachines = WaitFor(5000).Until(() => _butterflyCalled == 4);
|
||||||
|
|
||||||
commandOnAllStateMachines.ShouldBeTrue();
|
commandOnAllStateMachines.ShouldBeTrue();
|
||||||
|
@ -20,13 +20,11 @@ namespace Ocelot.AcceptanceTests
|
|||||||
private readonly Steps _steps;
|
private readonly Steps _steps;
|
||||||
private int _counterOne;
|
private int _counterOne;
|
||||||
|
|
||||||
|
|
||||||
public ClientRateLimitTests()
|
public ClientRateLimitTests()
|
||||||
{
|
{
|
||||||
_steps = new Steps();
|
_steps = new Steps();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
_builder?.Dispose();
|
_builder?.Dispose();
|
||||||
@ -92,7 +90,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_call_middleware_withWhitelistClient()
|
public void should_call_middleware_withWhitelistClient()
|
||||||
{
|
{
|
||||||
@ -147,7 +144,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenThereIsAServiceRunningOn(string baseUrl, string basePath)
|
private void GivenThereIsAServiceRunningOn(string baseUrl, string basePath)
|
||||||
{
|
{
|
||||||
_builder = new WebHostBuilder()
|
_builder = new WebHostBuilder()
|
||||||
|
@ -175,7 +175,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_load_configuration_out_of_consul_if_it_is_changed()
|
public void should_load_configuration_out_of_consul_if_it_is_changed()
|
||||||
{
|
{
|
||||||
|
@ -287,7 +287,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact(Skip = "This is just an example to show how you could hook into Ocelot pipeline with your own middleware. At the moment you must use Response.OnCompleted callback and cannot change the response :( I will see if this can be changed one day!")]
|
[Fact(Skip = "This is just an example to show how you could hook into Ocelot pipeline with your own middleware. At the moment you must use Response.OnCompleted callback and cannot change the response :( I will see if this can be changed one day!")]
|
||||||
public void should_fix_issue_237()
|
public void should_fix_issue_237()
|
||||||
{
|
{
|
||||||
|
@ -186,7 +186,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenThereIsAServiceRunningOn(string baseUrl, string basePath, int statusCode, string headerKey)
|
private void GivenThereIsAServiceRunningOn(string baseUrl, string basePath, int statusCode, string headerKey)
|
||||||
{
|
{
|
||||||
_builder = new WebHostBuilder()
|
_builder = new WebHostBuilder()
|
||||||
|
@ -543,7 +543,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_return_response_200_with_complex_url_that_starts_with_placeholder()
|
public void should_return_response_200_with_complex_url_that_starts_with_placeholder()
|
||||||
{
|
{
|
||||||
@ -578,7 +577,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_not_add_trailing_slash_to_downstream_url()
|
public void should_not_add_trailing_slash_to_downstream_url()
|
||||||
{
|
{
|
||||||
@ -834,7 +832,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_fix_145()
|
public void should_fix_145()
|
||||||
{
|
{
|
||||||
|
@ -58,7 +58,6 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_return_response_200_with_simple_url_and_hosts_match_multiple_re_routes()
|
public void should_return_response_200_with_simple_url_and_hosts_match_multiple_re_routes()
|
||||||
{
|
{
|
||||||
|
@ -484,7 +484,6 @@ namespace Ocelot.IntegrationTests
|
|||||||
app.UseOcelot().Wait();
|
app.UseOcelot().Wait();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
_builderTwo = _webHostBuilderTwo.Build();
|
_builderTwo = _webHostBuilderTwo.Build();
|
||||||
|
|
||||||
_builderTwo.Start();
|
_builderTwo.Start();
|
||||||
|
@ -93,7 +93,6 @@ namespace Ocelot.UnitTests.Claims
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenClaimsToThings(List<ClaimToThing> configuration)
|
private void GivenClaimsToThings(List<ClaimToThing> configuration)
|
||||||
{
|
{
|
||||||
_claimsToThings = configuration;
|
_claimsToThings = configuration;
|
||||||
|
@ -68,7 +68,6 @@ namespace Ocelot.UnitTests.Claims
|
|||||||
_middleware.Invoke(_downstreamContext).GetAwaiter().GetResult();
|
_middleware.Invoke(_downstreamContext).GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenTheDownStreamRouteIs(DownstreamRoute downstreamRoute)
|
private void GivenTheDownStreamRouteIs(DownstreamRoute downstreamRoute)
|
||||||
{
|
{
|
||||||
_downstreamContext.TemplatePlaceholderNameAndValues = downstreamRoute.TemplatePlaceholderNameAndValues;
|
_downstreamContext.TemplatePlaceholderNameAndValues = downstreamRoute.TemplatePlaceholderNameAndValues;
|
||||||
|
@ -869,7 +869,6 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(null)]
|
[InlineData(null)]
|
||||||
[InlineData("")]
|
[InlineData("")]
|
||||||
@ -1008,7 +1007,6 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenAConfiguration(FileConfiguration fileConfiguration)
|
private void GivenAConfiguration(FileConfiguration fileConfiguration)
|
||||||
{
|
{
|
||||||
_fileConfiguration = fileConfiguration;
|
_fileConfiguration = fileConfiguration;
|
||||||
|
@ -12,7 +12,6 @@ using Xunit;
|
|||||||
using Shouldly;
|
using Shouldly;
|
||||||
using static Ocelot.UnitTests.Wait;
|
using static Ocelot.UnitTests.Wait;
|
||||||
|
|
||||||
|
|
||||||
namespace Ocelot.UnitTests.Configuration
|
namespace Ocelot.UnitTests.Configuration
|
||||||
{
|
{
|
||||||
public class ConsulFileConfigurationPollerTests : IDisposable
|
public class ConsulFileConfigurationPollerTests : IDisposable
|
||||||
|
@ -502,7 +502,6 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
.WithUseServiceDiscovery(false)
|
.WithUseServiceDiscovery(false)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
|
|
||||||
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
||||||
{
|
{
|
||||||
ReRoutes = new List<FileReRoute>
|
ReRoutes = new List<FileReRoute>
|
||||||
@ -545,7 +544,6 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
.WithUpstreamTemplatePattern(new UpstreamPathTemplate("(?i)/api/products/.*/$", 1))
|
.WithUpstreamTemplatePattern(new UpstreamPathTemplate("(?i)/api/products/.*/$", 1))
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
|
|
||||||
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
this.Given(x => x.GivenTheConfigIs(new FileConfiguration
|
||||||
{
|
{
|
||||||
ReRoutes = new List<FileReRoute>
|
ReRoutes = new List<FileReRoute>
|
||||||
@ -915,7 +913,6 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
.Setup(x => x.Create(It.IsAny<FileGlobalConfiguration>())).Returns(serviceProviderConfiguration);
|
.Setup(x => x.Create(It.IsAny<FileGlobalConfiguration>())).Returns(serviceProviderConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenTheFollowingRegionIsReturned(string region)
|
private void GivenTheFollowingRegionIsReturned(string region)
|
||||||
{
|
{
|
||||||
_regionCreator
|
_regionCreator
|
||||||
|
@ -38,8 +38,6 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void GivenTheConfigurationIs(FileConfiguration fileConfiguration)
|
private void GivenTheConfigurationIs(FileConfiguration fileConfiguration)
|
||||||
{
|
{
|
||||||
_fileConfiguration = fileConfiguration;
|
_fileConfiguration = fileConfiguration;
|
||||||
|
@ -48,7 +48,6 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_return_error_if_unable_to_set_file_configuration()
|
public void should_return_error_if_unable_to_set_file_configuration()
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,6 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_use_base_url_partial_placeholder()
|
public void should_use_base_url_partial_placeholder()
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,6 @@ namespace Ocelot.UnitTests.Configuration
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_match_forward_slash_or_no_forward_slash_if_template_end_with_forward_slash()
|
public void should_match_forward_slash_or_no_forward_slash_if_template_end_with_forward_slash()
|
||||||
{
|
{
|
||||||
|
@ -111,7 +111,6 @@ namespace Ocelot.UnitTests.Controllers
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ThenTheNodeIsCalledCorrectly()
|
private void ThenTheNodeIsCalledCorrectly()
|
||||||
{
|
{
|
||||||
_node.Verify(x => x.Accept(It.IsAny<UpdateFileConfiguration>()), Times.Once);
|
_node.Verify(x => x.Accept(It.IsAny<UpdateFileConfiguration>()), Times.Once);
|
||||||
|
@ -70,7 +70,6 @@ namespace Ocelot.UnitTests.DependencyInjection
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_set_up_cache_manager()
|
public void should_set_up_cache_manager()
|
||||||
{
|
{
|
||||||
@ -151,7 +150,6 @@ namespace Ocelot.UnitTests.DependencyInjection
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_set_up_without_passing_in_config()
|
public void should_set_up_without_passing_in_config()
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,6 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
|
|||||||
_downstreamRouteFinder = new Ocelot.DownstreamRouteFinder.Finder.DownstreamRouteFinder(_mockMatcher.Object, _finder.Object);
|
_downstreamRouteFinder = new Ocelot.DownstreamRouteFinder.Finder.DownstreamRouteFinder(_mockMatcher.Object, _finder.Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_return_highest_priority_when_first()
|
public void should_return_highest_priority_when_first()
|
||||||
{
|
{
|
||||||
@ -182,7 +181,6 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_not_append_slash_to_upstream_url_path()
|
public void should_not_append_slash_to_upstream_url_path()
|
||||||
{
|
{
|
||||||
@ -598,7 +596,6 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_return_route_when_host_matches_but_null_host_on_same_path_first()
|
public void should_return_route_when_host_matches_but_null_host_on_same_path_first()
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,6 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder.UrlMatcher
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void can_match_down_stream_url_with_nothing_then_placeholder_no_value_is_blank()
|
public void can_match_down_stream_url_with_nothing_then_placeholder_no_value_is_blank()
|
||||||
{
|
{
|
||||||
|
@ -29,7 +29,6 @@ namespace Ocelot.UnitTests.Errors
|
|||||||
private DownstreamContext _downstreamContext;
|
private DownstreamContext _downstreamContext;
|
||||||
private OcelotRequestDelegate _next;
|
private OcelotRequestDelegate _next;
|
||||||
|
|
||||||
|
|
||||||
public ExceptionHandlerMiddlewareTests()
|
public ExceptionHandlerMiddlewareTests()
|
||||||
{
|
{
|
||||||
_provider = new Mock<IOcelotConfigurationProvider>();
|
_provider = new Mock<IOcelotConfigurationProvider>();
|
||||||
@ -174,7 +173,6 @@ namespace Ocelot.UnitTests.Errors
|
|||||||
.Setup(x => x.Get()).ReturnsAsync(response);
|
.Setup(x => x.Get()).ReturnsAsync(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenAnExceptionWillNotBeThrownDownstream()
|
private void GivenAnExceptionWillNotBeThrownDownstream()
|
||||||
{
|
{
|
||||||
_shouldThrowAnException = false;
|
_shouldThrowAnException = false;
|
||||||
|
@ -98,7 +98,6 @@ namespace Ocelot.UnitTests.Headers
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_replace_downstream_base_url_with_ocelot_base_url_and_path()
|
public void should_replace_downstream_base_url_with_ocelot_base_url_and_path()
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,6 @@ namespace Ocelot.UnitTests.Infrastructure
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_return_ok_if_null_allowed_scopes()
|
public void should_return_ok_if_null_allowed_scopes()
|
||||||
{
|
{
|
||||||
|
@ -116,7 +116,6 @@ namespace Ocelot.UnitTests.LoadBalancer
|
|||||||
_factory.Verify(x => x.Get(_reRoute, _serviceProviderConfig), Times.Once);
|
_factory.Verify(x => x.Get(_reRoute, _serviceProviderConfig), Times.Once);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenThereIsALoadBalancer(DownstreamReRoute reRoute, ILoadBalancer loadBalancer)
|
private void GivenThereIsALoadBalancer(DownstreamReRoute reRoute, ILoadBalancer loadBalancer)
|
||||||
{
|
{
|
||||||
_reRoute = reRoute;
|
_reRoute = reRoute;
|
||||||
|
@ -42,7 +42,6 @@ namespace Ocelot.UnitTests.Middleware
|
|||||||
.WithDownstreamReRoutes(downstreamReRoutes)
|
.WithDownstreamReRoutes(downstreamReRoutes)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
|
|
||||||
var billDownstreamContext = new DownstreamContext(new DefaultHttpContext())
|
var billDownstreamContext = new DownstreamContext(new DefaultHttpContext())
|
||||||
{
|
{
|
||||||
DownstreamResponse =
|
DownstreamResponse =
|
||||||
|
@ -19,7 +19,6 @@ namespace Ocelot.UnitTests.RateLimit
|
|||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
|
|
||||||
public class ClientRateLimitMiddlewareTests
|
public class ClientRateLimitMiddlewareTests
|
||||||
{
|
{
|
||||||
private int _responseStatusCode;
|
private int _responseStatusCode;
|
||||||
|
@ -165,7 +165,6 @@ namespace Ocelot.UnitTests.RequestId
|
|||||||
_repo.Verify(x => x.Update<string>("RequestId", _value), Times.Once);
|
_repo.Verify(x => x.Update<string>("RequestId", _value), Times.Once);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenTheDownStreamRouteIs(DownstreamRoute downstreamRoute)
|
private void GivenTheDownStreamRouteIs(DownstreamRoute downstreamRoute)
|
||||||
{
|
{
|
||||||
_downstreamContext.TemplatePlaceholderNameAndValues = downstreamRoute.TemplatePlaceholderNameAndValues;
|
_downstreamContext.TemplatePlaceholderNameAndValues = downstreamRoute.TemplatePlaceholderNameAndValues;
|
||||||
|
@ -41,7 +41,6 @@ namespace Ocelot.UnitTests.Requester
|
|||||||
.Returns(qosProvider);
|
.Returns(qosProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_all_from_all_routes_provider_and_qos()
|
public void should_all_from_all_routes_provider_and_qos()
|
||||||
{
|
{
|
||||||
|
@ -111,7 +111,6 @@ namespace Ocelot.UnitTests.Requester
|
|||||||
_getResult.Data.ShouldBe(_qoSProvider);
|
_getResult.Data.ShouldBe(_qoSProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void GivenThereIsAQoSProvider(DownstreamReRoute reRoute, IQoSProvider qoSProvider)
|
private void GivenThereIsAQoSProvider(DownstreamReRoute reRoute, IQoSProvider qoSProvider)
|
||||||
{
|
{
|
||||||
_reRoute = reRoute;
|
_reRoute = reRoute;
|
||||||
|
@ -45,7 +45,6 @@ namespace Ocelot.UnitTests.Responder
|
|||||||
ShouldMapErrorToStatusCode(OcelotErrorCode.RequestTimedOutError, HttpStatusCode.ServiceUnavailable);
|
ShouldMapErrorToStatusCode(OcelotErrorCode.RequestTimedOutError, HttpStatusCode.ServiceUnavailable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(OcelotErrorCode.CannotAddDataError)]
|
[InlineData(OcelotErrorCode.CannotAddDataError)]
|
||||||
[InlineData(OcelotErrorCode.CannotFindDataError)]
|
[InlineData(OcelotErrorCode.CannotFindDataError)]
|
||||||
|
@ -27,7 +27,6 @@ namespace Ocelot.UnitTests.Responder
|
|||||||
private readonly DownstreamContext _downstreamContext;
|
private readonly DownstreamContext _downstreamContext;
|
||||||
private OcelotRequestDelegate _next;
|
private OcelotRequestDelegate _next;
|
||||||
|
|
||||||
|
|
||||||
public ResponderMiddlewareTests()
|
public ResponderMiddlewareTests()
|
||||||
{
|
{
|
||||||
_responder = new Mock<IHttpResponder>();
|
_responder = new Mock<IHttpResponder>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user