diff --git a/README.md b/README.md index 0c1c880c..a1793f62 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,7 @@ A quick list of Ocelot's capabilities for more information see the [documentatio ## How to install -Ocelot is designed to work with ASP.NET core only and is currently -built to netcoreapp2.0 [this](https://docs.microsoft.com/en-us/dotnet/articles/standard/library) documentation may prove helpful when working out if Ocelot would be suitable for you. +Ocelot is designed to work with ASP.NET Core only and it targets `netstandard2.0`. This means it can be used anywhere `.NET Standard 2.0` is supported, including `.NET Core 2.0` and `.NET Framework 4.6.1` and up. [This](https://docs.microsoft.com/en-us/dotnet/standard/net-standard) documentation may prove helpful when working out if Ocelot would be suitable for you. Install Ocelot and it's dependencies using NuGet. diff --git a/docs/introduction/gettingstarted.rst b/docs/introduction/gettingstarted.rst index 089acc4f..f523ea1b 100644 --- a/docs/introduction/gettingstarted.rst +++ b/docs/introduction/gettingstarted.rst @@ -2,14 +2,14 @@ Getting Started =============== Ocelot is designed to work with .NET Core only and is currently -built to netcoreapp2.0 `this `_ documentation may prove helpful when working out if Ocelot would be suitable for you. +built to netstandard2.0 `this `_ documentation may prove helpful when working out if Ocelot would be suitable for you. .NET Core 2.0 ^^^^^^^^^^^^^ **Install NuGet package** -Install Ocelot and it's dependencies using nuget. You will need to create a netcoreapp2.0 project and bring the package into it. Then follow the Startup below and :doc:`../features/configuration` sections +Install Ocelot and it's dependencies using nuget. You will need to create a netstandard2.0 project and bring the package into it. Then follow the Startup below and :doc:`../features/configuration` sections to get up and running. ``Install-Package Ocelot`` diff --git a/src/Ocelot/Configuration/Creator/HeaderFindAndReplaceCreator.cs b/src/Ocelot/Configuration/Creator/HeaderFindAndReplaceCreator.cs index 1a5f1b6a..53f629af 100644 --- a/src/Ocelot/Configuration/Creator/HeaderFindAndReplaceCreator.cs +++ b/src/Ocelot/Configuration/Creator/HeaderFindAndReplaceCreator.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using Ocelot.Configuration.File; using Ocelot.Infrastructure; +using Ocelot.Infrastructure.Extensions; using Ocelot.Logging; using Ocelot.Middleware; using Ocelot.Responses; diff --git a/src/Ocelot/Configuration/File/FileAuthenticationOptions.cs b/src/Ocelot/Configuration/File/FileAuthenticationOptions.cs index 70e37690..873d1b5b 100644 --- a/src/Ocelot/Configuration/File/FileAuthenticationOptions.cs +++ b/src/Ocelot/Configuration/File/FileAuthenticationOptions.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Text; +using Ocelot.Infrastructure.Extensions; namespace Ocelot.Configuration.File { diff --git a/src/Ocelot/Configuration/File/FileRateLimitRule.cs b/src/Ocelot/Configuration/File/FileRateLimitRule.cs index 5e1616e6..7d1ca1ef 100644 --- a/src/Ocelot/Configuration/File/FileRateLimitRule.cs +++ b/src/Ocelot/Configuration/File/FileRateLimitRule.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Ocelot.Infrastructure.Extensions; namespace Ocelot.Configuration.File { diff --git a/src/Ocelot/Configuration/FileConfigurationController.cs b/src/Ocelot/Configuration/FileConfigurationController.cs index 3b88096f..1ea7fa7d 100644 --- a/src/Ocelot/Configuration/FileConfigurationController.cs +++ b/src/Ocelot/Configuration/FileConfigurationController.cs @@ -49,7 +49,7 @@ namespace Ocelot.Configuration if (test != null) { var node = (INode)test; - var result = node.Accept(new UpdateFileConfiguration(fileConfiguration)); + var result = await node.Accept(new UpdateFileConfiguration(fileConfiguration)); if (result.GetType() == typeof(Rafty.Concensus.ErrorResponse)) { return new BadRequestObjectResult("There was a problem. This error message sucks raise an issue in GitHub."); diff --git a/src/Ocelot/Headers/AddHeadersToResponse.cs b/src/Ocelot/Headers/AddHeadersToResponse.cs index 6cdf9a22..7c440d6a 100644 --- a/src/Ocelot/Headers/AddHeadersToResponse.cs +++ b/src/Ocelot/Headers/AddHeadersToResponse.cs @@ -3,6 +3,7 @@ namespace Ocelot.Headers using System.Collections.Generic; using Ocelot.Configuration.Creator; using Ocelot.Infrastructure; + using Ocelot.Infrastructure.Extensions; using Ocelot.Logging; using Ocelot.Middleware; diff --git a/src/Ocelot/Infrastructure/Extensions/NetCoreSupportExtensions.cs b/src/Ocelot/Infrastructure/Extensions/NetCoreSupportExtensions.cs new file mode 100644 index 00000000..3dee5caf --- /dev/null +++ b/src/Ocelot/Infrastructure/Extensions/NetCoreSupportExtensions.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ocelot.Infrastructure.Extensions +{ + /// + /// Trivial implementations of methods present in .NET Core 2 but not supported on .NET Standard 2.0. + /// + internal static class NetCoreSupportExtensions + { + internal static void AppendJoin(this StringBuilder builder, char separator, IEnumerable values) + { + builder.Append(string.Join(separator.ToString(), values)); + } + + internal static string[] Split(this string input, string separator, StringSplitOptions options = StringSplitOptions.None) + { + return input.Split(new[] { separator }, options); + } + + internal static bool StartsWith(this string input, char value) + { + return input.StartsWith(value.ToString()); + } + + internal static bool EndsWith(this string input, char value) + { + return input.EndsWith(value.ToString()); + } + } +} diff --git a/src/Ocelot/LoadBalancer/LoadBalancers/CookieStickySessions.cs b/src/Ocelot/LoadBalancer/LoadBalancers/CookieStickySessions.cs index b64c4b43..357ea84e 100644 --- a/src/Ocelot/LoadBalancer/LoadBalancers/CookieStickySessions.cs +++ b/src/Ocelot/LoadBalancer/LoadBalancers/CookieStickySessions.cs @@ -35,7 +35,7 @@ namespace Ocelot.LoadBalancer.LoadBalancers { if (stickySession.Expiry < DateTime.UtcNow) { - _stored.Remove(stickySession.Key, out _); + _stored.TryRemove(stickySession.Key, out _); _loadBalancer.Release(stickySession.HostAndPort); } } diff --git a/src/Ocelot/Ocelot.csproj b/src/Ocelot/Ocelot.csproj index 833887a2..5bd94b0c 100644 --- a/src/Ocelot/Ocelot.csproj +++ b/src/Ocelot/Ocelot.csproj @@ -1,6 +1,6 @@ - netcoreapp2.0 + netstandard2.0 2.0.0 2.0.0 true @@ -25,18 +25,26 @@ True - + + + NU1701 + - - - - - - - - - - + + + + + + + + + + NU1701 + + + + + all @@ -45,9 +53,9 @@ - + - - + + diff --git a/src/Ocelot/Raft/FileFsm.cs b/src/Ocelot/Raft/FileFsm.cs index 13c41c9d..afa47d26 100644 --- a/src/Ocelot/Raft/FileFsm.cs +++ b/src/Ocelot/Raft/FileFsm.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Threading.Tasks; using Newtonsoft.Json; using Rafty.FiniteStateMachine; using Rafty.Infrastructure; @@ -17,7 +18,7 @@ namespace Ocelot.Raft _id = nodeId.Id.Replace("/","").Replace(":",""); } - public void Handle(LogEntry log) + public Task Handle(LogEntry log) { try { @@ -28,6 +29,8 @@ namespace Ocelot.Raft { Console.WriteLine(exception); } + + return Task.CompletedTask; } } } diff --git a/src/Ocelot/Raft/HttpPeer.cs b/src/Ocelot/Raft/HttpPeer.cs index b89c884c..93d81cd4 100644 --- a/src/Ocelot/Raft/HttpPeer.cs +++ b/src/Ocelot/Raft/HttpPeer.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Net.Http; +using System.Threading.Tasks; using Newtonsoft.Json; using Ocelot.Configuration; using Ocelot.Middleware; @@ -33,50 +34,46 @@ namespace Ocelot.Raft _baseSchemeUrlAndPort = finder.Find(); } - public string Id {get; private set;} + public string Id { get; } - public RequestVoteResponse Request(RequestVote requestVote) + public async Task Request(RequestVote requestVote) { if(_token == null) { - SetToken(); + await SetToken(); } var json = JsonConvert.SerializeObject(requestVote, _jsonSerializerSettings); var content = new StringContent(json); content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); - var response = _httpClient.PostAsync($"{_hostAndPort}/administration/raft/requestvote", content).GetAwaiter().GetResult(); + var response = await _httpClient.PostAsync($"{_hostAndPort}/administration/raft/requestvote", content); if(response.IsSuccessStatusCode) { - return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), _jsonSerializerSettings); - } - else - { - return new RequestVoteResponse(false, requestVote.Term); + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync(), _jsonSerializerSettings); } + + return new RequestVoteResponse(false, requestVote.Term); } - public AppendEntriesResponse Request(AppendEntries appendEntries) + public async Task Request(AppendEntries appendEntries) { try { if(_token == null) { - SetToken(); - } + await SetToken(); + } var json = JsonConvert.SerializeObject(appendEntries, _jsonSerializerSettings); var content = new StringContent(json); content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); - var response = _httpClient.PostAsync($"{_hostAndPort}/administration/raft/appendEntries", content).GetAwaiter().GetResult(); + var response = await _httpClient.PostAsync($"{_hostAndPort}/administration/raft/appendEntries", content); if(response.IsSuccessStatusCode) { - return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(),_jsonSerializerSettings); - } - else - { - return new AppendEntriesResponse(appendEntries.Term, false); + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync(), _jsonSerializerSettings); } + + return new AppendEntriesResponse(appendEntries.Term, false); } catch(Exception ex) { @@ -85,33 +82,31 @@ namespace Ocelot.Raft } } - public Response Request(T command) + public async Task> Request(T command) where T : ICommand { Console.WriteLine("SENDING REQUEST...."); if(_token == null) { - SetToken(); + await SetToken(); } var json = JsonConvert.SerializeObject(command, _jsonSerializerSettings); var content = new StringContent(json); content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); - var response = _httpClient.PostAsync($"{_hostAndPort}/administration/raft/command", content).GetAwaiter().GetResult(); + var response = await _httpClient.PostAsync($"{_hostAndPort}/administration/raft/command", content); if(response.IsSuccessStatusCode) { Console.WriteLine("REQUEST OK...."); - var okResponse = JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), _jsonSerializerSettings); + var okResponse = JsonConvert.DeserializeObject>(await response.Content.ReadAsStringAsync(), _jsonSerializerSettings); return new OkResponse((T)okResponse.Command); } - else - { - Console.WriteLine("REQUEST NOT OK...."); - return new ErrorResponse(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), command); - } + + Console.WriteLine("REQUEST NOT OK...."); + return new ErrorResponse(await response.Content.ReadAsStringAsync(), command); } - private void SetToken() + private async Task SetToken() { var tokenUrl = $"{_baseSchemeUrlAndPort}{_config.AdministrationPath}/connect/token"; var formData = new List> @@ -122,8 +117,8 @@ namespace Ocelot.Raft new KeyValuePair("grant_type", "client_credentials") }; var content = new FormUrlEncodedContent(formData); - var response = _httpClient.PostAsync(tokenUrl, content).GetAwaiter().GetResult(); - var responseContent = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); + var response = await _httpClient.PostAsync(tokenUrl, content); + var responseContent = await response.Content.ReadAsStringAsync(); response.EnsureSuccessStatusCode(); _token = JsonConvert.DeserializeObject(responseContent); _httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(_token.TokenType, _token.AccessToken); diff --git a/src/Ocelot/Raft/OcelotFiniteStateMachine.cs b/src/Ocelot/Raft/OcelotFiniteStateMachine.cs index feecd7d7..b3d7720f 100644 --- a/src/Ocelot/Raft/OcelotFiniteStateMachine.cs +++ b/src/Ocelot/Raft/OcelotFiniteStateMachine.cs @@ -1,3 +1,4 @@ +using System.Threading.Tasks; using Ocelot.Configuration.Setter; using Rafty.FiniteStateMachine; using Rafty.Log; @@ -14,12 +15,12 @@ namespace Ocelot.Raft _setter = setter; } - public void Handle(LogEntry log) + public async Task Handle(LogEntry log) { //todo - handle an error //hack it to just cast as at the moment we know this is the only command :P var hack = (UpdateFileConfiguration)log.CommandData; - _setter.Set(hack.Configuration).GetAwaiter().GetResult(); + await _setter.Set(hack.Configuration); } } } diff --git a/src/Ocelot/Raft/RaftController.cs b/src/Ocelot/Raft/RaftController.cs index c1222e4d..0b8d4989 100644 --- a/src/Ocelot/Raft/RaftController.cs +++ b/src/Ocelot/Raft/RaftController.cs @@ -20,9 +20,9 @@ namespace Ocelot.Raft public class RaftController : Controller { private readonly INode _node; - private IOcelotLogger _logger; - private string _baseSchemeUrlAndPort; - private JsonSerializerSettings _jsonSerialiserSettings; + private readonly IOcelotLogger _logger; + private readonly string _baseSchemeUrlAndPort; + private readonly JsonSerializerSettings _jsonSerialiserSettings; public RaftController(INode node, IOcelotLoggerFactory loggerFactory, IBaseUrlFinder finder) { @@ -45,7 +45,7 @@ namespace Ocelot.Raft _logger.LogDebug($"{_baseSchemeUrlAndPort}/appendentries called, my state is {_node.State.GetType().FullName}"); - var appendEntriesResponse = _node.Handle(appendEntries); + var appendEntriesResponse = await _node.Handle(appendEntries); return new OkObjectResult(appendEntriesResponse); } @@ -62,7 +62,7 @@ namespace Ocelot.Raft _logger.LogDebug($"{_baseSchemeUrlAndPort}/requestvote called, my state is {_node.State.GetType().FullName}"); - var requestVoteResponse = _node.Handle(requestVote); + var requestVoteResponse = await _node.Handle(requestVote); return new OkObjectResult(requestVoteResponse); } @@ -81,7 +81,7 @@ namespace Ocelot.Raft _logger.LogDebug($"{_baseSchemeUrlAndPort}/command called, my state is {_node.State.GetType().FullName}"); - var commandResponse = _node.Accept(command); + var commandResponse = await _node.Accept(command); json = JsonConvert.SerializeObject(commandResponse, _jsonSerialiserSettings); @@ -91,7 +91,7 @@ namespace Ocelot.Raft catch(Exception e) { _logger.LogError($"THERE WAS A PROBLEM ON NODE {_node.State.CurrentState.Id}", e); - throw e; + throw; } } } diff --git a/src/Ocelot/Raft/SqlLiteLog.cs b/src/Ocelot/Raft/SqlLiteLog.cs index aff04bf5..f0db2047 100644 --- a/src/Ocelot/Raft/SqlLiteLog.cs +++ b/src/Ocelot/Raft/SqlLiteLog.cs @@ -5,9 +5,11 @@ using Newtonsoft.Json; using System; using Rafty.Infrastructure; using System.Collections.Generic; +using System.Threading.Tasks; namespace Ocelot.Raft -{ +{ + //todo - use async await [ExcludeFromCoverage] public class SqlLiteLog : ILog { @@ -40,89 +42,80 @@ namespace Ocelot.Raft } } - public int LastLogIndex + public Task LastLogIndex() { - get + lock(_lock) { - lock(_lock) + var result = 1; + using(var connection = new SqliteConnection($"Data Source={_path};")) { - var result = 1; - using(var connection = new SqliteConnection($"Data Source={_path};")) + connection.Open(); + var sql = @"select id from logs order by id desc limit 1"; + using(var command = new SqliteCommand(sql, connection)) { - connection.Open(); - var sql = @"select id from logs order by id desc limit 1"; - using(var command = new SqliteCommand(sql, connection)) + var index = Convert.ToInt32(command.ExecuteScalar()); + if(index > result) { - var index = Convert.ToInt32(command.ExecuteScalar()); - if(index > result) - { - result = index; - } + result = index; } } - - return result; } + + return Task.FromResult(result); } } - public long LastLogTerm + public Task LastLogTerm () { - get + lock(_lock) { - lock(_lock) + long result = 0; + using(var connection = new SqliteConnection($"Data Source={_path};")) { - long result = 0; - using(var connection = new SqliteConnection($"Data Source={_path};")) + connection.Open(); + var sql = @"select data from logs order by id desc limit 1"; + using(var command = new SqliteCommand(sql, connection)) { - connection.Open(); - var sql = @"select data from logs order by id desc limit 1"; - using(var command = new SqliteCommand(sql, connection)) + var data = Convert.ToString(command.ExecuteScalar()); + var jsonSerializerSettings = new JsonSerializerSettings() { + TypeNameHandling = TypeNameHandling.All + }; + var log = JsonConvert.DeserializeObject(data, jsonSerializerSettings); + if(log != null && log.Term > result) { - var data = Convert.ToString(command.ExecuteScalar()); - var jsonSerializerSettings = new JsonSerializerSettings() { - TypeNameHandling = TypeNameHandling.All - }; - var log = JsonConvert.DeserializeObject(data, jsonSerializerSettings); - if(log != null && log.Term > result) - { - result = log.Term; - } + result = log.Term; } } - - return result; } + + return Task.FromResult(result); } } - public int Count + public Task Count () { - get + lock(_lock) { - lock(_lock) + var result = 0; + using(var connection = new SqliteConnection($"Data Source={_path};")) { - var result = 0; - using(var connection = new SqliteConnection($"Data Source={_path};")) + connection.Open(); + var sql = @"select count(id) from logs"; + using(var command = new SqliteCommand(sql, connection)) { - connection.Open(); - var sql = @"select count(id) from logs"; - using(var command = new SqliteCommand(sql, connection)) + var index = Convert.ToInt32(command.ExecuteScalar()); + if(index > result) { - var index = Convert.ToInt32(command.ExecuteScalar()); - if(index > result) - { - result = index; - } + result = index; } } - - return result; } + + return Task.FromResult(result); } } - public int Apply(LogEntry log) + public Task Apply(LogEntry log) { lock(_lock) { @@ -145,13 +138,13 @@ namespace Ocelot.Raft using(var command = new SqliteCommand(sql, connection)) { var result = command.ExecuteScalar(); - return Convert.ToInt32(result); + return Task.FromResult(Convert.ToInt32(result)); } } } } - public void DeleteConflictsFromThisLog(int index, LogEntry logEntry) + public Task DeleteConflictsFromThisLog(int index, LogEntry logEntry) { lock(_lock) { @@ -174,15 +167,17 @@ namespace Ocelot.Raft var deleteSql = $"delete from logs where id >= {index};"; using(var deleteCommand = new SqliteCommand(deleteSql, connection)) { - var result = deleteCommand.ExecuteNonQuery(); + var result = deleteCommand.ExecuteNonQuery(); } } } } } + + return Task.CompletedTask; } - public LogEntry Get(int index) + public Task Get(int index) { lock(_lock) { @@ -199,13 +194,13 @@ namespace Ocelot.Raft TypeNameHandling = TypeNameHandling.All }; var log = JsonConvert.DeserializeObject(data, jsonSerializerSettings); - return log; + return Task.FromResult(log); } } } } - public System.Collections.Generic.List<(int index, LogEntry logEntry)> GetFrom(int index) + public Task> GetFrom(int index) { lock(_lock) { @@ -235,11 +230,11 @@ namespace Ocelot.Raft } } - return logsToReturn; + return Task.FromResult(logsToReturn); } } - public long GetTermAtIndex(int index) + public Task GetTermAtIndex(int index) { lock(_lock) { @@ -264,11 +259,11 @@ namespace Ocelot.Raft } } - return result; + return Task.FromResult(result); } } - public void Remove(int indexOfCommand) + public Task Remove(int indexOfCommand) { lock(_lock) { @@ -284,6 +279,8 @@ namespace Ocelot.Raft } } } + + return Task.CompletedTask; } } } diff --git a/src/Ocelot/Requester/HttpClientBuilder.cs b/src/Ocelot/Requester/HttpClientBuilder.cs index 6d3ffcb0..18160e02 100644 --- a/src/Ocelot/Requester/HttpClientBuilder.cs +++ b/src/Ocelot/Requester/HttpClientBuilder.cs @@ -52,7 +52,7 @@ namespace Ocelot.Requester if(context.DownstreamReRoute.DangerousAcceptAnyServerCertificateValidator) { - httpclientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; + httpclientHandler.ServerCertificateCustomValidationCallback = (request, certificate, chain, errors) => true; _logger .LogWarning($"You have ignored all SSL warnings by using DangerousAcceptAnyServerCertificateValidator for this DownstreamReRoute, UpstreamPathTemplate: {context.DownstreamReRoute.UpstreamPathTemplate}, DownstreamPathTemplate: {context.DownstreamReRoute.DownstreamPathTemplate}"); diff --git a/test/Ocelot.AcceptanceTests/AuthenticationTests.cs b/test/Ocelot.AcceptanceTests/AuthenticationTests.cs index bc76ccff..770deaa1 100644 --- a/test/Ocelot.AcceptanceTests/AuthenticationTests.cs +++ b/test/Ocelot.AcceptanceTests/AuthenticationTests.cs @@ -316,8 +316,6 @@ namespace Ocelot.AcceptanceTests { new Scope("api2"), new Scope("api2.readOnly"), - new Scope("openid"), - new Scope("offline_access") }, ApiSecrets = new List() { diff --git a/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj b/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj index 9edbfd74..fe4877ec 100644 --- a/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj +++ b/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj @@ -34,26 +34,27 @@ - - + + all - - - - - - - - + + + + + + + + - + + diff --git a/test/Ocelot.AcceptanceTests/Steps.cs b/test/Ocelot.AcceptanceTests/Steps.cs index 72fad48b..5041088e 100644 --- a/test/Ocelot.AcceptanceTests/Steps.cs +++ b/test/Ocelot.AcceptanceTests/Steps.cs @@ -664,7 +664,8 @@ namespace Ocelot.AcceptanceTests { using (var httpClient = new HttpClient()) { - var response = httpClient.GetAsync($"{url}/.well-known/openid-configuration").Result; + var response = httpClient.GetAsync($"{url}/.well-known/openid-configuration").GetAwaiter().GetResult(); + var content = response.Content.ReadAsStringAsync().GetAwaiter(); response.EnsureSuccessStatusCode(); } } diff --git a/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj b/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj index 7761dab1..e97450d3 100644 --- a/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj +++ b/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj @@ -19,7 +19,7 @@ - + all diff --git a/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj b/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj index 97c8782f..5ec67320 100644 --- a/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj +++ b/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj @@ -25,26 +25,26 @@ - + all - - - - - - - + + + + + + + - + - + \ No newline at end of file diff --git a/test/Ocelot.IntegrationTests/RaftTests.cs b/test/Ocelot.IntegrationTests/RaftTests.cs index a7a173e0..96cd6687 100644 --- a/test/Ocelot.IntegrationTests/RaftTests.cs +++ b/test/Ocelot.IntegrationTests/RaftTests.cs @@ -263,7 +263,7 @@ namespace Ocelot.IntegrationTests catch(Exception e) { //_output.WriteLine($"{e.Message}, {e.StackTrace}"); - //Console.WriteLine(e); + Console.WriteLine(e); return false; } } diff --git a/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj b/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj index a43e6b23..b7c3ac18 100644 --- a/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj +++ b/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj @@ -24,16 +24,16 @@ - - - - - - - - + + + + + + + + - + all diff --git a/test/Ocelot.UnitTests/Controllers/FileConfigurationControllerTests.cs b/test/Ocelot.UnitTests/Controllers/FileConfigurationControllerTests.cs index 520d8274..41cc3573 100644 --- a/test/Ocelot.UnitTests/Controllers/FileConfigurationControllerTests.cs +++ b/test/Ocelot.UnitTests/Controllers/FileConfigurationControllerTests.cs @@ -126,14 +126,14 @@ namespace Ocelot.UnitTests.Controllers { _node .Setup(x => x.Accept(It.IsAny())) - .Returns(new Rafty.Concensus.OkResponse(new UpdateFileConfiguration(new FileConfiguration()))); + .ReturnsAsync(new Rafty.Concensus.OkResponse(new UpdateFileConfiguration(new FileConfiguration()))); } private void GivenTheNodeReturnsError() { _node .Setup(x => x.Accept(It.IsAny())) - .Returns(new Rafty.Concensus.ErrorResponse("error", new UpdateFileConfiguration(new FileConfiguration()))); + .ReturnsAsync(new Rafty.Concensus.ErrorResponse("error", new UpdateFileConfiguration(new FileConfiguration()))); } private void GivenTheConfigSetterReturns(Response response) diff --git a/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj b/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj index 395dde67..9aa7db12 100644 --- a/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj +++ b/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj @@ -29,30 +29,30 @@ - - + + all - - - - - - - + + + + + + + + -