+semver: upgrade to net5.0 (#1390)

* breaking upgrade base build image to net5.0

* add make and build tools to image

* fix code broken after net5.0 upgrade

* fix warnings

* fix tests and line endings

* upgrade dotnet test and coverages packages

* update circle build image

* removed rafty and updated more packages

* bring back develop

* rename authorisation to authorization
This commit is contained in:
Tom Pallister
2020-12-11 09:54:08 +00:00
committed by GitHub
parent c3a0cf1160
commit b74a1197a2
130 changed files with 4766 additions and 6210 deletions

View File

@@ -10,7 +10,7 @@
using System.Net;
using System.Threading.Tasks;
using TestStack.BDDfy;
using Xunit;
using Xunit;
public class CustomMiddlewareTests : IDisposable
{
@@ -32,13 +32,13 @@
{
var configuration = new OcelotPipelineConfiguration
{
AuthorisationMiddleware = async (ctx, next) =>
AuthorizationMiddleware = async (ctx, next) =>
{
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@@ -73,17 +73,17 @@
}
[Fact]
public void should_call_authorisation_middleware()
public void should_call_authorization_middleware()
{
var configuration = new OcelotPipelineConfiguration
{
AuthorisationMiddleware = async (ctx, next) =>
AuthorizationMiddleware = async (ctx, next) =>
{
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@@ -127,8 +127,8 @@
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@@ -172,8 +172,8 @@
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@@ -208,17 +208,17 @@
}
[Fact]
public void should_call_pre_authorisation_middleware()
public void should_call_pre_authorization_middleware()
{
var configuration = new OcelotPipelineConfiguration
{
PreAuthorisationMiddleware = async (ctx, next) =>
PreAuthorizationMiddleware = async (ctx, next) =>
{
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@@ -262,8 +262,8 @@
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@@ -295,8 +295,8 @@
.Then(x => _steps.ThenTheStatusCodeShouldBe(HttpStatusCode.OK))
.And(x => x.ThenTheCounterIs(1))
.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!")]
public void should_fix_issue_237()
{
@@ -305,14 +305,14 @@
var httpContext = (HttpContext)state;
if (httpContext.Response.StatusCode > 400)
{
{
Debug.WriteLine("COUNT CALLED");
Console.WriteLine("COUNT CALLED");
}
return Task.CompletedTask;
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@@ -376,8 +376,8 @@
public class FakeMiddleware
{
private readonly RequestDelegate _next;
private readonly Func<object, Task> _callback;
private readonly Func<object, Task> _callback;
public FakeMiddleware(RequestDelegate next, Func<object, Task> callback)
{
_next = next;
@@ -386,10 +386,10 @@
public async Task Invoke(HttpContext context)
{
await _next(context);
await _next(context);
context.Response.OnCompleted(_callback, context);
}
}
}
}
}