Swamy/15jan2021 small refactoring (#1580)

* Small Refactoring inside Basket Service folder

* Small Refactoring
This commit is contained in:
Viswanatha Swamy 2021-01-19 17:36:15 +05:30 committed by GitHub
parent afb4534acc
commit 130e46ccdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 36 additions and 33 deletions

View File

@ -12,6 +12,7 @@ namespace Basket.API.Infrastructure.Middlewares
private bool _mustFail;
private readonly FailingOptions _options;
private readonly ILogger _logger;
public FailingMiddleware(RequestDelegate next, ILogger<FailingMiddleware> logger, FailingOptions options)
{
_next = next;
@ -19,6 +20,7 @@ namespace Basket.API.Infrastructure.Middlewares
_mustFail = false;
_logger = logger;
}
public async Task Invoke(HttpContext context)
{
var path = context.Request.Path;

View File

@ -61,7 +61,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
})
.ConfigureAppConfiguration(x => x.AddConfiguration(configuration))
.UseFailing(options => {
.UseFailing(options =>
{
options.ConfigPath = "/Failing";
options.NotFilteredPaths.AddRange(new[] { "/hc", "/liveness" });
})

View File

@ -1,9 +1,9 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Microsoft.eShopOnContainers.Services.Basket.API;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace Basket.FunctionalTests.Base
{