Skip to content

Commit

Permalink
Update nuget non-major dependencies (#166)
Browse files Browse the repository at this point in the history
* Update nuget non-major dependencies

* GetRuleConfiguration now returns NoContent after Altinn/app-lib-dotnet#174 was merged

* maxSize in applicationmetadata.json is now repected after Altinn/app-lib-dotnet#121 was merged. Updated testdata

* PdfService extended with new PDFClient. Tests not updated to test new service

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vemund Gaukstad <tjololo@users.noreply.github.com>
  • Loading branch information
renovate[bot] and tjololo committed Apr 28, 2023
1 parent d134b3d commit ae2e102
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/App.IntegrationTests/ApiTests/ResourceApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public async Task GetRuleHandler_Ok()
}

[Fact]
public async Task GetRuleConfiguration_NoFileInLayoutSet_Ok()
public async Task GetRuleConfiguration_NoFileInLayoutSet_NoContent()
{
string token = PrincipalUtil.GetToken(1337);
HttpClient client = SetupUtil.GetTestClient(_factory, "ttd", "frontend-test");
Expand All @@ -86,7 +86,7 @@ public async Task GetRuleConfiguration_NoFileInLayoutSet_Ok()
HttpResponseMessage response = await client.SendAsync(httpRequestMessage);
string responseContent = await response.Content.ReadAsStringAsync();

Assert.Equal(System.Net.HttpStatusCode.OK, response.StatusCode);
Assert.Equal(System.Net.HttpStatusCode.NoContent, response.StatusCode);
}
}
}
6 changes: 3 additions & 3 deletions src/App.IntegrationTests/App.IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.12" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.16" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand Down
6 changes: 3 additions & 3 deletions src/App.IntegrationTests/AppRef.IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.12" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.16" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@
"id": "skattemelding",
"allowedContentTypes": [ "text/xml" ],
"taskId": "Task_1",
"maxSize": 0,
"maxSize": 10,
"maxCount": 1,
"minCount": 1
},
{
"id": "næringsoppgave",
"allowedContentTypes": [ "text/xml" ],
"taskId": "Task_1",
"maxSize": 1,
"maxSize": 10,
"maxCount": 1,
"minCount": 1
},
{
"id": "næringsoppgavepdf",
"allowedContentTypes": [ "application/pdf" ],
"taskId": "Task_2",
"maxSize": 1,
"maxSize": 10,
"maxCount": 1,
"minCount": 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Altinn.App.Core.Implementation;
using Altinn.App.Core.Infrastructure.Clients.Pdf;
using Altinn.App.Core.Interface;
using Altinn.App.Core.Internal.App;
using Altinn.App.Core.Internal.Pdf;
using Altinn.Platform.Profile.Models;
using Altinn.Platform.Register.Enums;
Expand Down Expand Up @@ -110,7 +111,8 @@ internal virtual PDFClient MockPdfClient(Action<HttpRequestMessage, Cancellation
internal virtual AppResourcesSI BuildAppResourcesService()
{
var appOptionSettings = BuildAppOptionSettings();
var appResources = new AppResourcesSI(appOptionSettings, null, null);
var appMetadataService = new AppMetadata(appOptionSettings, new FrontendFeatures());
var appResources = new AppResourcesSI(appOptionSettings, appMetadataService, null, null);

return appResources;
}
Expand Down Expand Up @@ -138,6 +140,21 @@ internal virtual IOptions<AppSettings> BuildAppOptionSettings()
return Options.Create(appSettings);
}

internal virtual IOptions<GeneralSettings> BuildGeneralSettings()
{
var generalSettings = new GeneralSettings()
{

};
return Options.Create(generalSettings);
}

internal virtual IOptions<PdfGeneratorSettings> BuildPdfGeneratorSettings()
{
var pdfGeneratorSettings = new PdfGeneratorSettings();
return Options.Create(pdfGeneratorSettings);
}

internal virtual Altinn.App.Core.Internal.Pdf.PdfService BuildPdfService(Action<HttpRequestMessage, CancellationToken> onDataPostCallback)
{
PDFClient pdfClient = MockPdfClient(onDataPostCallback);
Expand All @@ -146,11 +163,14 @@ internal virtual Altinn.App.Core.Internal.Pdf.PdfService BuildPdfService(Action<
Mock<IData> dataClient = MockDataClient();
Mock<IHttpContextAccessor> httpContextAccessor = MockUserInHttpContext();
Mock<IProfile> profileClient = MockProfileClient();
Mock<IPdfGeneratorClient> pdfGeneratorClientMock = new Mock<IPdfGeneratorClient>();
var registerClient = new Mock<IRegister>();
var customPdfHandler = new NullPdfFormatter();
var pdfOptionsMapping = new PdfOptionsMapping(appOptionsService);
var pdfGeneratorSettings =BuildPdfGeneratorSettings();
var generalSettings = BuildGeneralSettings();

var pdfService = new Altinn.App.Core.Internal.Pdf.PdfService(pdfClient, appResources, pdfOptionsMapping, dataClient.Object, httpContextAccessor.Object, profileClient.Object, registerClient.Object, customPdfHandler);
var pdfService = new Altinn.App.Core.Internal.Pdf.PdfService(pdfClient, appResources, pdfOptionsMapping, dataClient.Object, httpContextAccessor.Object, profileClient.Object, registerClient.Object, customPdfHandler, pdfGeneratorClientMock.Object, pdfGeneratorSettings, generalSettings);

return pdfService;
}
Expand Down
6 changes: 3 additions & 3 deletions src/App/App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Altinn.App.Api" Version="7.1.4">
<PackageReference Include="Altinn.App.Api" Version="7.8.0">
<CopyToOutputDirectory>lib\$(TargetFramework)\*.xml</CopyToOutputDirectory>
</PackageReference>
<PackageReference Include="Altinn.App.Core" Version="7.1.4"/>
<PackageReference Include="Altinn.App.Core" Version="7.8.0"/>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0"/>
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/App/AppRef.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Altinn.App.Api" Version="7.1.4">
<PackageReference Include="Altinn.App.Api" Version="7.8.0">
<CopyToOutputDirectory>lib\$(TargetFramework)\*.xml</CopyToOutputDirectory>
</PackageReference>
<PackageReference Include="Altinn.App.Core" Version="7.1.4" />
<PackageReference Include="Altinn.App.Core" Version="7.8.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

<PropertyGroup>
Expand Down

0 comments on commit ae2e102

Please sign in to comment.