From 870e9a5334cd1b82c28600e56f2b4100da44e96f Mon Sep 17 00:00:00 2001 From: danielmarbach Date: Wed, 13 Mar 2024 08:43:00 +0100 Subject: [PATCH 1/3] Delete unneeded class --- .../WebApi/UnderscoreMappingResolver.cs | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 src/ServiceControl.Monitoring/Infrastructure/WebApi/UnderscoreMappingResolver.cs diff --git a/src/ServiceControl.Monitoring/Infrastructure/WebApi/UnderscoreMappingResolver.cs b/src/ServiceControl.Monitoring/Infrastructure/WebApi/UnderscoreMappingResolver.cs deleted file mode 100644 index a7ee11ba4d..0000000000 --- a/src/ServiceControl.Monitoring/Infrastructure/WebApi/UnderscoreMappingResolver.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace ServiceControl.Monitoring.Infrastructure.WebApi -{ - using System.Globalization; - using System.Text.RegularExpressions; - using Newtonsoft.Json.Serialization; - - class UnderscoreMappingResolver : DefaultContractResolver - { - protected override string ResolvePropertyName(string propertyName) - { - return Regex.Replace( - propertyName, "([A-Z])([A-Z][a-z])|([a-z0-9])([A-Z])", "$1$3_$2$4").ToLower(CultureInfo.InvariantCulture); - } - } -} \ No newline at end of file From cb7ddbf12dcb293ac52da6990f084a5db25e5398 Mon Sep 17 00:00:00 2001 From: danielmarbach Date: Wed, 13 Mar 2024 08:43:08 +0100 Subject: [PATCH 2/3] Replace TODO with explanation --- .../When_querying_queue_length_data.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ServiceControl.Monitoring.AcceptanceTests/When_querying_queue_length_data.cs b/src/ServiceControl.Monitoring.AcceptanceTests/When_querying_queue_length_data.cs index 31e560f980..19883e5956 100644 --- a/src/ServiceControl.Monitoring.AcceptanceTests/When_querying_queue_length_data.cs +++ b/src/ServiceControl.Monitoring.AcceptanceTests/When_querying_queue_length_data.cs @@ -82,7 +82,7 @@ await Define() return false; } - // TODO this should be using camalCase (the same for a few other monitoring acceptance tests, something sounds off with the json options + // Metric names are fixed names and therefore are not following the casing rules of the chosen serializer if (monitoredEndpointDetails.Digest.Metrics.TryGetValue("QueueLength", out var queueLength) && queueLength.Average == 0.0) { return false; From 4fa37f596db01fee70214eba5f41e3e3fbc74649 Mon Sep 17 00:00:00 2001 From: danielmarbach Date: Wed, 13 Mar 2024 08:48:01 +0100 Subject: [PATCH 3/3] Removed OWIN namespace and folder --- .../Infrastructure/{OWIN => WebApi}/BodyUrlRouteFix.cs | 2 +- src/ServiceControl.Audit/WebApplicationExtensions.cs | 2 +- .../Infrastructure/{OWIN => WebApi}/BodyUrlRouteFix.cs | 2 +- src/ServiceControl/WebApplicationExtensions.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename src/ServiceControl.Audit/Infrastructure/{OWIN => WebApi}/BodyUrlRouteFix.cs (94%) rename src/ServiceControl/Infrastructure/{OWIN => WebApi}/BodyUrlRouteFix.cs (95%) diff --git a/src/ServiceControl.Audit/Infrastructure/OWIN/BodyUrlRouteFix.cs b/src/ServiceControl.Audit/Infrastructure/WebApi/BodyUrlRouteFix.cs similarity index 94% rename from src/ServiceControl.Audit/Infrastructure/OWIN/BodyUrlRouteFix.cs rename to src/ServiceControl.Audit/Infrastructure/WebApi/BodyUrlRouteFix.cs index 9792811d06..52afcb4d75 100644 --- a/src/ServiceControl.Audit/Infrastructure/OWIN/BodyUrlRouteFix.cs +++ b/src/ServiceControl.Audit/Infrastructure/WebApi/BodyUrlRouteFix.cs @@ -1,4 +1,4 @@ -namespace ServiceControl.Audit.Infrastructure.OWIN +namespace ServiceControl.Audit.Infrastructure.WebApi { using System.Threading.Tasks; using Microsoft.AspNetCore.Http; diff --git a/src/ServiceControl.Audit/WebApplicationExtensions.cs b/src/ServiceControl.Audit/WebApplicationExtensions.cs index ddb62b7736..905f62da29 100644 --- a/src/ServiceControl.Audit/WebApplicationExtensions.cs +++ b/src/ServiceControl.Audit/WebApplicationExtensions.cs @@ -1,7 +1,7 @@ namespace ServiceControl.Audit; +using Infrastructure.WebApi; using Microsoft.AspNetCore.Builder; -using Infrastructure.OWIN; public static class WebApplicationExtensions { diff --git a/src/ServiceControl/Infrastructure/OWIN/BodyUrlRouteFix.cs b/src/ServiceControl/Infrastructure/WebApi/BodyUrlRouteFix.cs similarity index 95% rename from src/ServiceControl/Infrastructure/OWIN/BodyUrlRouteFix.cs rename to src/ServiceControl/Infrastructure/WebApi/BodyUrlRouteFix.cs index 8ca2a3f3d4..78a8dba4e6 100644 --- a/src/ServiceControl/Infrastructure/OWIN/BodyUrlRouteFix.cs +++ b/src/ServiceControl/Infrastructure/WebApi/BodyUrlRouteFix.cs @@ -1,4 +1,4 @@ -namespace ServiceControl.Infrastructure.OWIN +namespace ServiceControl.Infrastructure.WebApi { using System.Threading.Tasks; using Microsoft.AspNetCore.Http; diff --git a/src/ServiceControl/WebApplicationExtensions.cs b/src/ServiceControl/WebApplicationExtensions.cs index 51f202f6fd..a5ca376937 100644 --- a/src/ServiceControl/WebApplicationExtensions.cs +++ b/src/ServiceControl/WebApplicationExtensions.cs @@ -1,7 +1,7 @@ namespace ServiceControl; -using Infrastructure.OWIN; using Infrastructure.SignalR; +using Infrastructure.WebApi; using Microsoft.AspNetCore.Builder; public static class WebApplicationExtensions