From 1422aff8282a6396879079d70e0f31b71e859098 Mon Sep 17 00:00:00 2001 From: Jakob Ehn Date: Tue, 2 Jan 2024 09:33:01 +0100 Subject: [PATCH] Remove PropertyNamingPolicy assignments in tests. Default serialization has changed in .NET 8 for HTTP API error response classes (see https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/8.0/problemdetails-custom-converters). Setting PropertyNamingPolicy to NULL will return PascalCase, removing these assignments which will verify that the default behaviour is to return camel case --- .../BankId_UiAuth_Tests.cs | 4 ---- .../BankId_UiSign_Tests.cs | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiAuth_Tests.cs b/test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiAuth_Tests.cs index 4f23e4be..6390757b 100644 --- a/test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiAuth_Tests.cs +++ b/test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiAuth_Tests.cs @@ -502,10 +502,6 @@ public async Task Api_Always_Returns_CamelCase_Json_For_Http400BadRequest() { services.AddTransient(s => _bankIdUiOptionsProtector.Object); services.AddTransient(s => _bankIdUiStateProtector.Object); - services.AddMvc().AddJsonOptions(configure => - { - configure.JsonSerializerOptions.PropertyNamingPolicy = null; - }); }); diff --git a/test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiSign_Tests.cs b/test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiSign_Tests.cs index 322caee7..c57c2349 100644 --- a/test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiSign_Tests.cs +++ b/test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiSign_Tests.cs @@ -4,6 +4,7 @@ using System.Net; using System.Net.Http; using System.Text.Encodings.Web; +using System.Text.Json; using System.Threading.Tasks; using ActiveLogin.Authentication.BankId.Api; @@ -503,10 +504,6 @@ public async Task Api_Always_Returns_CamelCase_Json_For_Http400BadRequest() { services.AddTransient(s => _bankIdUiOptionsProtector.Object); services.AddTransient(s => _bankIdUiStateProtector.Object); - services.AddMvc().AddJsonOptions(configure => - { - configure.JsonSerializerOptions.PropertyNamingPolicy = null; - }); });