Clean up explicit test dependencies for System.Text.Json serializer (#16017)
This commit is contained in:
@@ -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<IJsonSerializer, SystemTextJsonSerializer>();
|
||||
|
||||
private IContentTypeService ContentTypeService => GetRequiredService<IContentTypeService>();
|
||||
|
||||
private IContentService ContentService => GetRequiredService<IContentService>();
|
||||
|
||||
@@ -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<ILanguageService>();
|
||||
|
||||
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<IJsonSerializer, SystemTextJsonSerializer>();
|
||||
services.AddSingleton<IConfigurationEditorJsonSerializer, SystemTextConfigurationEditorJsonSerializer>();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Can_Validate_Block_List_Nested_In_Block_List()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user