diff --git a/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs index bf5781079a..1bfa3a7ed0 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs @@ -28,7 +28,7 @@ namespace Umbraco.Cms.Core.PropertyEditors; Icon = "icon-thumbnail-list", ValueEditorIsReusable = false, IsDeprecated = true)] -[Obsolete("Nested content is obsolete, will be removed in V13")] +[Obsolete("Nested content is obsolete, will be removed in Umbraco 14")] public class NestedContentPropertyEditor : DataEditor { public const string ContentTypeAliasPropertyKey = "ncContentTypeAlias"; @@ -36,7 +36,7 @@ public class NestedContentPropertyEditor : DataEditor private readonly IIOHelper _ioHelper; private readonly INestedContentPropertyIndexValueFactory _nestedContentPropertyIndexValueFactory; - [Obsolete("Use non-obsoleted ctor. This will be removed in Umbraco 12.")] + [Obsolete("Use non-obsoleted ctor. This will be removed in Umbraco 14.")] public NestedContentPropertyEditor( IDataValueEditorFactory dataValueEditorFactory, IIOHelper ioHelper) @@ -44,7 +44,7 @@ public class NestedContentPropertyEditor : DataEditor { } - [Obsolete("Use non-obsoleted ctor. This will be removed in Umbraco 13.")] + [Obsolete("Use non-obsoleted ctor. This will be removed in Umbraco 14.")] public NestedContentPropertyEditor( IDataValueEditorFactory dataValueEditorFactory, IIOHelper ioHelper, diff --git a/src/Umbraco.Infrastructure/Serialization/ConfigurationEditorJsonSerializer.cs b/src/Umbraco.Infrastructure/Serialization/ConfigurationEditorJsonSerializer.cs index 82f6e01475..8c94cb53c1 100644 --- a/src/Umbraco.Infrastructure/Serialization/ConfigurationEditorJsonSerializer.cs +++ b/src/Umbraco.Infrastructure/Serialization/ConfigurationEditorJsonSerializer.cs @@ -10,10 +10,8 @@ public class ConfigurationEditorJsonSerializer : JsonNetSerializer, IConfigurati { public ConfigurationEditorJsonSerializer() { - JsonSerializerSettings.Converters.Add(new FuzzyBooleanConverter()); - JsonSerializerSettings.ContractResolver = new ConfigurationCustomContractResolver(); - JsonSerializerSettings.Formatting = Formatting.None; - JsonSerializerSettings.NullValueHandling = NullValueHandling.Ignore; + Settings.Converters.Add(new FuzzyBooleanConverter()); + Settings.ContractResolver = new ConfigurationCustomContractResolver(); } private class ConfigurationCustomContractResolver : DefaultContractResolver diff --git a/src/Umbraco.Infrastructure/Serialization/JsonNetSerializer.cs b/src/Umbraco.Infrastructure/Serialization/JsonNetSerializer.cs index dfab4ba5e4..8057ba6168 100644 --- a/src/Umbraco.Infrastructure/Serialization/JsonNetSerializer.cs +++ b/src/Umbraco.Infrastructure/Serialization/JsonNetSerializer.cs @@ -7,23 +7,20 @@ namespace Umbraco.Cms.Infrastructure.Serialization; public class JsonNetSerializer : IJsonSerializer { - protected static readonly JsonSerializerSettings JsonSerializerSettings = new() + protected JsonSerializerSettings Settings { get; } = new() { Converters = new List { new StringEnumConverter() }, Formatting = Formatting.None, NullValueHandling = NullValueHandling.Ignore, }; - public string Serialize(object? input) => JsonConvert.SerializeObject(input, JsonSerializerSettings); + public string Serialize(object? input) => JsonConvert.SerializeObject(input, Settings); - public T? Deserialize(string input) => JsonConvert.DeserializeObject(input, JsonSerializerSettings); + public T? Deserialize(string input) => JsonConvert.DeserializeObject(input, Settings); public T? DeserializeSubset(string input, string key) { - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } + ArgumentNullException.ThrowIfNull(key); JObject? root = Deserialize(input); JToken? jToken = root?.SelectToken(key); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookLogServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookLogServiceTests.cs index 7716f83eda..af75becd1c 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookLogServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookLogServiceTests.cs @@ -1,4 +1,5 @@ -using NUnit.Framework; +using System.Globalization; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; @@ -37,7 +38,7 @@ public class WebhookLogServiceTests : UmbracoIntegrationTest Assert.IsNotEmpty(webhookLogsPaged.Items); Assert.AreEqual(1, webhookLogsPaged.Items.Count()); var webHookLog = webhookLogsPaged.Items.First(); - Assert.AreEqual(createdWebhookLog.Date, webHookLog.Date); + Assert.AreEqual(createdWebhookLog.Date.ToString(CultureInfo.InvariantCulture), webHookLog.Date.ToString(CultureInfo.InvariantCulture)); Assert.AreEqual(createdWebhookLog.EventName, webHookLog.EventName); Assert.AreEqual(createdWebhookLog.RequestBody, webHookLog.RequestBody); Assert.AreEqual(createdWebhookLog.ResponseBody, webHookLog.ResponseBody);