diff --git a/src/Altinn.App.Api/Altinn.App.Api.csproj b/src/Altinn.App.Api/Altinn.App.Api.csproj index bb16215f2..3bb643875 100644 --- a/src/Altinn.App.Api/Altinn.App.Api.csproj +++ b/src/Altinn.App.Api/Altinn.App.Api.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -13,7 +13,7 @@ git https://github.com/Altinn/app-lib-dotnet true - true + enable {E8F29FE8-6B62-41F1-A08C-2A318DD08BB4} diff --git a/src/Altinn.App.Api/Controllers/PagesController.cs b/src/Altinn.App.Api/Controllers/PagesController.cs index c9181ad4e..dc212350a 100644 --- a/src/Altinn.App.Api/Controllers/PagesController.cs +++ b/src/Altinn.App.Api/Controllers/PagesController.cs @@ -31,8 +31,8 @@ public class PagesController : ControllerBase /// The page order service public PagesController( IAppModel appModel, - IAppResources resources, - IPageOrder pageOrder, + IAppResources resources, + IPageOrder pageOrder, ILogger logger) { _appModel = appModel; diff --git a/src/Altinn.App.Api/Helpers/StartupHelper.cs b/src/Altinn.App.Api/Helpers/StartupHelper.cs index 9bac3be5f..6ef8a00ea 100644 --- a/src/Altinn.App.Api/Helpers/StartupHelper.cs +++ b/src/Altinn.App.Api/Helpers/StartupHelper.cs @@ -43,6 +43,6 @@ public static string GetApplicationId() { string appMetaDataString = File.ReadAllText("config/applicationmetadata.json"); JObject appMetadataJObject = JObject.Parse(appMetaDataString); - return appMetadataJObject.SelectToken("id").Value(); + return appMetadataJObject.SelectToken("id")?.Value() ?? throw new Exception("config/applicationmetadata.json does not contain an \"id\" property"); } } \ No newline at end of file diff --git a/test/Altinn.App.Api.Tests/Controllers/ValidateControllerValidateDataTests.cs b/test/Altinn.App.Api.Tests/Controllers/ValidateControllerValidateDataTests.cs index 3cb418a19..2e76cc67c 100644 --- a/test/Altinn.App.Api.Tests/Controllers/ValidateControllerValidateDataTests.cs +++ b/test/Altinn.App.Api.Tests/Controllers/ValidateControllerValidateDataTests.cs @@ -9,6 +9,7 @@ using Altinn.App.Core.Models.Validation; using Altinn.Platform.Storage.Interface.Models; using Microsoft.AspNetCore.Mvc; +using FluentAssertions; using Moq; using Xunit; @@ -221,7 +222,7 @@ public async Task TestValidateData(ValidateDataTestScenario testScenario) { var result = await validateController.ValidateData(org, app, instanceOwnerId, testScenario.InstanceId, testScenario.DataGuid); - Assert.IsType(testScenario.ExpectedResult, result); + result.Should().BeOfType(testScenario.ExpectedResult); } else { diff --git a/test/Altinn.App.Api.Tests/Mocks/Authentication/JwtCookiePostConfigureOptionsStub.cs b/test/Altinn.App.Api.Tests/Mocks/Authentication/JwtCookiePostConfigureOptionsStub.cs index 6ff3aae21..2e3a9f2ce 100644 --- a/test/Altinn.App.Api.Tests/Mocks/Authentication/JwtCookiePostConfigureOptionsStub.cs +++ b/test/Altinn.App.Api.Tests/Mocks/Authentication/JwtCookiePostConfigureOptionsStub.cs @@ -14,7 +14,7 @@ namespace Altinn.App.Api.Tests.Mocks.Authentication public class JwtCookiePostConfigureOptionsStub : IPostConfigureOptions { /// - public void PostConfigure(string name, JwtCookieOptions options) + public void PostConfigure(string? name, JwtCookieOptions options) { if (string.IsNullOrEmpty(options.JwtCookieName)) { diff --git a/test/Altinn.App.Api.Tests/Mocks/PepWithPDPAuthorizationMockSI.cs b/test/Altinn.App.Api.Tests/Mocks/PepWithPDPAuthorizationMockSI.cs index a4ad04ad2..bb0100c59 100644 --- a/test/Altinn.App.Api.Tests/Mocks/PepWithPDPAuthorizationMockSI.cs +++ b/test/Altinn.App.Api.Tests/Mocks/PepWithPDPAuthorizationMockSI.cs @@ -61,7 +61,7 @@ public async Task GetDecisionForRequest(XacmlJsonRequestRoot } catch { - return null; + return null!; } }