From 45a169f62bfe099424e401b9c0ee33932baf692c Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 11 Apr 2024 09:17:48 +0200 Subject: [PATCH] Clean up explicit test dependencies for System.Text.Json serializer (#16017) --- .../PropertyEditors/RichTextPropertyEditorTests.cs | 7 ------- .../Services/ContentValidationServiceTests.cs | 9 --------- 2 files changed, 16 deletions(-) diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditorTests.cs index c2a2088041..84717ac203 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditorTests.cs @@ -1,4 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; @@ -6,7 +5,6 @@ using Umbraco.Cms.Core.Models.Blocks; using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.Serialization; using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Infrastructure.Serialization; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; @@ -17,11 +15,6 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.PropertyEditors; [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] public class RichTextPropertyEditorTests : UmbracoIntegrationTest { - // FIXME: This test NEEDS the System.Text.Json serializer. - // When the ContextualJsonSerializer is removed, this can be removed too. - protected override void CustomTestSetup(IUmbracoBuilder builder) - => builder.Services.AddSingleton(); - private IContentTypeService ContentTypeService => GetRequiredService(); private IContentService ContentService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentValidationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentValidationServiceTests.cs index e1c9516b5e..5ba83bafac 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentValidationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentValidationServiceTests.cs @@ -1,4 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; @@ -6,7 +5,6 @@ using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.Serialization; using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Infrastructure.Serialization; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; using Umbraco.Cms.Tests.Common.Testing; @@ -25,13 +23,6 @@ public class ContentValidationServiceTests : UmbracoIntegrationTestWithContent private ILanguageService LanguageService => GetRequiredService(); - protected override void ConfigureTestServices(IServiceCollection services) - { - // block list requires System.Text.Json as serializer - currently we still perform fallback to Json.NET in tests - services.AddSingleton(); - services.AddSingleton(); - } - [Test] public async Task Can_Validate_Block_List_Nested_In_Block_List() {