Skip to content

Commit 1f95f7b

Browse files
authored
Upgrade to .NET 10 (#108)
1 parent 51e5c5e commit 1f95f7b

13 files changed

Lines changed: 37 additions & 39 deletions

File tree

source/AAS.TwinEngine.DataEngine.ModuleTests/AAS.TwinEngine.DataEngine.ModuleTests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

@@ -11,7 +11,7 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="coverlet.collector" Version="10.0.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.26" />
14+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.7" />
1515
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
1616
<PackageReference Include="NSubstitute" Version="5.3.0" />
1717
<PackageReference Include="xunit" Version="2.9.3" />

source/AAS.TwinEngine.DataEngine.ModuleTests/Api/Services/AasRegistry/ShellDescriptorControllerTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
using AAS.TwinEngine.DataEngine.ApplicationLogic.Services.Plugin.Providers;
1010
using AAS.TwinEngine.DataEngine.Infrastructure.Http.Clients;
1111
using AAS.TwinEngine.DataEngine.ModuleTests.Common;
12+
using AAS.TwinEngine.DataEngine.ServiceConfiguration.Config;
1213

1314
using Microsoft.AspNetCore.WebUtilities;
1415
using Microsoft.Extensions.DependencyInjection;
1516

1617
using NSubstitute;
1718
using NSubstitute.ExceptionExtensions;
1819

19-
using AAS.TwinEngine.DataEngine.ServiceConfiguration.Config;
20-
2120
namespace AAS.TwinEngine.DataEngine.ModuleTests.Api.Services.AasRegistry;
2221

2322
public abstract class ShellDescriptorControllerTests : IDisposable
@@ -85,7 +84,7 @@ public async Task GetAllShellDescriptorsAsync_ReturnsOkAsync()
8584
_ = _mockTemplateProvider.GetShellDescriptorsTemplateAsync(Arg.Any<CancellationToken>()).Returns(template);
8685

8786
// Act
88-
var response = await _client.GetAsync("/shell-descriptors?limit=2&cursor=next123");
87+
var response = await _client.GetAsync("/shell-descriptors?limit=2&cursor=bmV4dDEyMw==");
8988

9089
// Assert
9190
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
@@ -101,7 +100,7 @@ public async Task GetAllShellDescriptorsAsync_WithNagetiveLimit_Returns400Async(
101100
{
102101
_ = _mockTemplateProvider.GetShellDescriptorsTemplateAsync(Arg.Any<CancellationToken>()).Throws(new ResourceNotFoundException());
103102

104-
var response = await _client.GetAsync("/shell-descriptors?limit=-1&cursor=next123");
103+
var response = await _client.GetAsync("/shell-descriptors?limit=-1&cursor=bmV4dDEyMw==");
105104

106105
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
107106
}
@@ -121,7 +120,7 @@ public async Task GetAllShellDescriptorsAsync_WithNotFound_Returns404Async()
121120
{
122121
_ = _mockTemplateProvider.GetShellDescriptorsTemplateAsync(Arg.Any<CancellationToken>()).Throws(new ResourceNotFoundException());
123122

124-
var response = await _client.GetAsync("/shell-descriptors?limit=5&cursor=next123");
123+
var response = await _client.GetAsync("/shell-descriptors?limit=5&cursor=bmV4dDEyMw==");
125124

126125
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
127126
}
@@ -131,7 +130,7 @@ public async Task GetAllShellDescriptorsAsync_WithInternalServerError_Returns500
131130
{
132131
_ = _mockTemplateProvider.GetShellDescriptorsTemplateAsync(Arg.Any<CancellationToken>()).Throws(new ResponseParsingException());
133132

134-
var response = await _client.GetAsync("/shell-descriptors?limit=5&cursor=next123");
133+
var response = await _client.GetAsync("/shell-descriptors?limit=5&cursor=bmV4dDEyMw==");
135134

136135
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
137136
}

source/AAS.TwinEngine.DataEngine.ModuleTests/Api/Services/AasRepository/AasRepositoryControllerTests.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using AAS.TwinEngine.DataEngine.ApplicationLogic.Services.Plugin.Providers;
1111
using AAS.TwinEngine.DataEngine.Infrastructure.Http.Clients;
1212
using AAS.TwinEngine.DataEngine.ModuleTests.Common;
13+
using AAS.TwinEngine.DataEngine.ServiceConfiguration.Config;
1314

1415
using AasCore.Aas3_0;
1516

@@ -19,8 +20,6 @@
1920
using NSubstitute;
2021
using NSubstitute.ExceptionExtensions;
2122

22-
using AAS.TwinEngine.DataEngine.ServiceConfiguration.Config;
23-
2423
namespace AAS.TwinEngine.DataEngine.ModuleTests.Api.Services.AasRepository;
2524

2625
public abstract class AasRepositoryControllerTests : IDisposable
@@ -237,7 +236,7 @@ public async Task GetSubmodelRefByIdAsync_ReturnsOkAsync()
237236
_ = _mockTemplateProvider.GetSubmodelRefByIdAsync(Arg.Any<string>(), Arg.Any<CancellationToken>()).Returns(mockTemplate);
238237

239238
// Act
240-
var response = await _client.GetAsync($"/shells/{AasIdentifier}/submodel-refs?limit=5&cursor=next123");
239+
var response = await _client.GetAsync($"/shells/{AasIdentifier}/submodel-refs?limit=5&cursor=bmV4dDEyMw==");
241240

242241
// Assert
243242
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
@@ -249,10 +248,9 @@ public async Task GetSubmodelRefByIdAsync_ReturnsOkAsync()
249248
public async Task GetSubmodelRefByIdAsync_WithInternalServerError_Returns500Async()
250249
{
251250
const string AasIdentifier = "aHR0cHM6Ly9leGFtcGxlLmNvbS9pZHMvYWFzLzExNzBfMTE2MF8zMDUyXzY1Njg=";
252-
253251
_ = _mockTemplateProvider.GetSubmodelRefByIdAsync(Arg.Any<string>(), Arg.Any<CancellationToken>()).Throws(new ResponseParsingException());
254252

255-
var response = await _client.GetAsync($"/shells/{AasIdentifier}/submodel-refs?limit=5&cursor=next123");
253+
var response = await _client.GetAsync($"/shells/{AasIdentifier}/submodel-refs?limit=5&cursor=bmV4dDEyMw==");
256254

257255
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
258256
}

source/AAS.TwinEngine.DataEngine.ModuleTests/Api/Services/SubmodelRepository/SerializationControllerTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public void Dispose()
5252
public async Task SerializeAasxAsync_ReturnsOkAsync()
5353
{
5454
// Arrange
55-
var aasIds = new[] { "aas-123" };
56-
var submodelIds = new[] { "submodel-456" };
55+
var aasIds = new[] { "YWFzLTEyMw==" };
56+
var submodelIds = new[] { "c3VibW9kZWwtNDU2" };
5757

5858
var url = $"/serialization?aasIds={string.Join("&aasIds=", aasIds)}&submodelIds={string.Join("&submodelIds=", submodelIds)}&includeConceptDescriptions=false";
5959
var mockSubmodel = TestData.CreateSubmodel();
@@ -74,8 +74,8 @@ public async Task SerializeAasxAsync_ReturnsOkAsync()
7474
public async Task SerializeAasxAsync_ReturnsOkAsync_WhenConceptDescriptionsIsTrueAsync()
7575
{
7676
// Arrange
77-
var aasIds = new[] { "aas-123" };
78-
var submodelIds = new[] { "submodel-456" };
77+
var aasIds = new[] { "YWFzLTEyMw==" };
78+
var submodelIds = new[] { "c3VibW9kZWwtNDU2" };
7979

8080
var url = $"/serialization?aasIds={string.Join("&aasIds=", aasIds)}&submodelIds={string.Join("&submodelIds=", submodelIds)}&includeConceptDescriptions=true";
8181
var mockSubmodel = TestData.CreateSubmodel();
@@ -98,8 +98,8 @@ public async Task SerializeAasxAsync_ReturnsOkAsync_WhenConceptDescriptionsIsTru
9898
public async Task SerializeAasxAsync_WithNotFound_Returns404Async()
9999
{
100100
// Arrange
101-
var aasIds = new[] { "aas-123" };
102-
var submodelIds = new[] { "submodel-456" };
101+
var aasIds = new[] { "YWFzLTEyMw==" };
102+
var submodelIds = new[] { "c3VibW9kZWwtNDU2" };
103103

104104
var url = $"/serialization?aasIds={string.Join("&aasIds=", aasIds)}&submodelIds={string.Join("&submodelIds=", submodelIds)}&includeConceptDescriptions=false";
105105

@@ -116,8 +116,8 @@ public async Task SerializeAasxAsync_WithNotFound_Returns404Async()
116116
public async Task SerializeAasxAsync_WithInternalServerError_Returns500Async()
117117
{
118118
// Arrange
119-
var aasIds = new[] { "aas-123" };
120-
var submodelIds = new[] { "submodel-456" };
119+
var aasIds = new[] { "YWFzLTEyMw==" };
120+
var submodelIds = new[] { "c3VibW9kZWwtNDU2" };
121121

122122
var url = $"/serialization?aasIds={string.Join("&aasIds=", aasIds)}&submodelIds={string.Join("&submodelIds=", submodelIds)}&includeConceptDescriptions=false";
123123

@@ -134,7 +134,7 @@ public async Task SerializeAasxAsync_WithInternalServerError_Returns500Async()
134134
public async Task SerializeAasxAsync_WhenIdentifierIsInValid_Returns400Async()
135135
{
136136
// Arrange
137-
var aasIds = new[] { "aas-123" };
137+
var aasIds = new[] { "YWFzLTEyMw==" };
138138
var submodelIds = new[] { "in valid" };
139139

140140
var url = $"/serialization?aasIds={string.Join("&aasIds=", aasIds)}&submodelIds={string.Join("&submodelIds=", submodelIds)}&includeConceptDescriptions=false";

source/AAS.TwinEngine.DataEngine.UnitTests/AAS.TwinEngine.DataEngine.UnitTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

source/AAS.TwinEngine.DataEngine/AAS.TwinEngine.DataEngine.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
@@ -21,7 +21,7 @@
2121
<ItemGroup>
2222
<PackageReference Include="AasCore.Aas3.Package" Version="1.0.4" />
2323
<PackageReference Include="AasCore.Aas3_0" Version="1.0.6" />
24-
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.1" />
24+
<PackageReference Include="Asp.Versioning.Mvc" Version="10.0.0" />
2525
<PackageReference Include="Cronos" Version="0.13.0" />
2626
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.7" />
2727
<PackageReference Include="NSwag.AspNetCore" Version="14.7.1" />

source/AAS.TwinEngine.DataEngine/Api/AasRegistry/ShellDescriptorController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class ShellDescriptorController(
2323
[ProducesResponseType(typeof(ShellDescriptorsDto), (int)HttpStatusCode.OK)]
2424
[ProducesResponseType(typeof(ServiceErrorResponse), (int)HttpStatusCode.NotFound)]
2525
[ProducesResponseType(typeof(ServiceErrorResponse), (int)HttpStatusCode.InternalServerError)]
26-
public async Task<ActionResult<ShellDescriptorsDto>> GetAllShellDescriptorsAsync(int? limit, [FromQuery] string? cursor, CancellationToken cancellationToken)
26+
public async Task<ActionResult<ShellDescriptorsDto>> GetAllShellDescriptorsAsync([FromQuery] int? limit, [FromQuery] string? cursor, CancellationToken cancellationToken)
2727
{
2828
logger.LogInformation("Get All ShellDescriptors");
2929
var request = new GetShellDescriptorsRequest(limit, cursor);

source/AAS.TwinEngine.DataEngine/Api/AasRepository/AasRepositoryController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public async Task<ActionResult<JsonObject>> GetAssetInformationByIdAsync([FromRo
5252
[ProducesResponseType(typeof(ServiceErrorResponse), (int)HttpStatusCode.BadRequest)]
5353
[ProducesResponseType(typeof(ServiceErrorResponse), (int)HttpStatusCode.NotFound)]
5454
[ProducesResponseType(typeof(ServiceErrorResponse), (int)HttpStatusCode.InternalServerError)]
55-
public async Task<ActionResult<JsonObject>> GetSubmodelRefByIdAsync([FromRoute] string aasIdentifier, int? limit, [FromQuery] string? cursor, CancellationToken cancellationToken)
55+
public async Task<ActionResult<JsonObject>> GetSubmodelRefByIdAsync([FromRoute] string aasIdentifier, [FromQuery] int? limit, [FromQuery] string? cursor, CancellationToken cancellationToken)
5656
{
5757
logger.LogInformation("Start request to get submodel-refs for shell");
5858
var request = new GetSubmodelRefRequest(aasIdentifier, limit, cursor);

source/AAS.TwinEngine.DataEngine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:8.0@sha256:aa05b91be697b83229cb000b90120f0783604ad74ed92a0b45cdf3d1a9c873de AS build
1+
FROM mcr.microsoft.com/dotnet/sdk@sha256:8a90a473da5205a16979de99d2fc20975e922c68304f5c79d564e666dc3982fc AS build
22
# Install CycloneDX SBOM Generator Package
33
RUN dotnet tool install --global CycloneDX --version 5.5.0
44
ENV PATH="$PATH:/root/.dotnet/tools"
@@ -16,7 +16,7 @@ FROM scratch AS app-sbom-artifact
1616
COPY --from=build /App/sbom/bom.xml /sbom_application.cyclonedx.xml
1717

1818
# Create final image containing application
19-
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine@sha256:a0ce42fe86548363a9602c47fc3bd4cf9c35a2705c68cd98d7ce18ae8735b83c
19+
FROM mcr.microsoft.com/dotnet/aspnet@sha256:60eb031b554df75a4b9f358290a2fa15d8961a3bc79b47bb34a00e31f7b78c69
2020
USER app
2121
WORKDIR /App
2222
COPY --from=build /App/out .

source/AAS.TwinEngine.Plugin.TestPlugin.PlaywrightTests/AAS.TwinEngine.Plugin.TestPlugin.PlaywrightTests.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

@@ -13,6 +13,7 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="coverlet.collector" Version="10.0.0" />
16+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.7" />
1617
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
1718
<PackageReference Include="Microsoft.Playwright" Version="1.59.0" />
1819
<PackageReference Include="Microsoft.Playwright.NUnit" Version="1.59.0" />

0 commit comments

Comments
 (0)