diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 15562a3f..da6edae3 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ['7.0'] + dotnet-version: ['8.0'] steps: - name: Set up JDK 17 diff --git a/.github/workflows/unit.tests-formatting.yml b/.github/workflows/unit.tests-formatting.yml index a778917f..8d2e8aa6 100644 --- a/.github/workflows/unit.tests-formatting.yml +++ b/.github/workflows/unit.tests-formatting.yml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ['7.0'] + dotnet-version: ['8.0'] steps: - uses: actions/checkout@v4 diff --git a/DEPENDENCIES b/DEPENDENCIES index 8965f9a8..08405a02 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,8 +1,7 @@ -nuget/nuget/-/AutoFixture.AutoFakeItEasy/4.18.0, MIT, approved, #10064 -nuget/nuget/-/AutoFixture.Xunit/4.18.0, MIT, approved, #10082 -nuget/nuget/-/AutoFixture/4.18.0, MIT, approved, #10057 +nuget/nuget/-/AutoFixture.AutoFakeItEasy/4.18.1, MIT, approved, #10064 +nuget/nuget/-/AutoFixture/4.18.1, MIT, approved, #10057 nuget/nuget/-/Castle.Core/4.3.1, Apache-2.0, approved, clearlydefined -nuget/nuget/-/EFCore.NamingConventions/7.0.2, Apache-2.0, approved, #10067 +nuget/nuget/-/EFCore.NamingConventions/8.0.3, Apache-2.0, approved, #13983 nuget/nuget/-/FakeItEasy/7.4.0, MIT, approved, #10080 nuget/nuget/-/Fare/2.1.1, MIT, approved, clearlydefined nuget/nuget/-/FluentAssertions/6.11.0, Apache-2.0 AND MIT, approved, #10061 @@ -10,31 +9,31 @@ nuget/nuget/-/Flurl.Signed/3.0.6, MIT, approved, #3501 nuget/nuget/-/Humanizer.Core/2.14.1, MIT, approved, #10060 nuget/nuget/-/Json.More.Net/2.0.0, MIT, approved, clearlydefined nuget/nuget/-/JsonPointer.Net/4.0.0, MIT, approved, clearlydefined -nuget/nuget/-/JsonSchema.Net/6.0.3, MIT AND OFL-1.1 AND CC-BY-SA-4.0, approved, #13370 -nuget/nuget/-/Laraue.EfCoreTriggers.Common/7.1.0, MIT, approved, #10247 -nuget/nuget/-/Laraue.EfCoreTriggers.PostgreSql/7.1.0, MIT, approved, #10248 +nuget/nuget/-/JsonSchema.Net/6.1.2, MIT AND OFL-1.1 AND CC-BY-SA-4.0, approved, #14591 +nuget/nuget/-/Laraue.EfCoreTriggers.Common/8.0.3, MIT, approved, #13968 +nuget/nuget/-/Laraue.EfCoreTriggers.PostgreSql/8.0.3, MIT, approved, #13984 nuget/nuget/-/Mono.TextTemplating/2.2.1, MIT, approved, clearlydefined nuget/nuget/-/Newtonsoft.Json/13.0.1, MIT AND BSD-3-Clause, approved, #3266 nuget/nuget/-/Newtonsoft.Json/13.0.3, MIT AND BSD-3-Clause, approved, #3266 -nuget/nuget/-/Npgsql.EntityFrameworkCore.PostgreSQL/7.0.11, PostgreSQL AND MIT AND Apache-2.0, approved, #10081 -nuget/nuget/-/Npgsql/7.0.6, PostgreSQL, approved, #10062 +nuget/nuget/-/Npgsql.EntityFrameworkCore.PostgreSQL/8.0.2, PostgreSQL AND MIT, approved, #13972 +nuget/nuget/-/Npgsql/8.0.2, PostgreSQL, approved, #13963 nuget/nuget/-/PasswordGenerator/2.1.0, MIT, approved, #3192 nuget/nuget/-/Portable.BouncyCastle/1.9.0, MIT, approved, clearlydefined nuget/nuget/-/SSH.NET/2020.0.2, MIT AND ISC AND LicenseRef-Public-domain AND (MIT AND MS-PL), approved, #10073 -nuget/nuget/-/Serilog.AspNetCore/7.0.0, Apache-2.0 AND MIT, approved, #10084 +nuget/nuget/-/Serilog.AspNetCore/8.0.1, Apache-2.0 AND MIT, approved, #13967 nuget/nuget/-/Serilog.Enrichers.CorrelationId/3.0.1, MIT, approved, clearlydefined -nuget/nuget/-/Serilog.Enrichers.Environment/2.2.0, Apache-2.0, approved, clearlydefined +nuget/nuget/-/Serilog.Enrichers.Environment/2.3.0, Apache-2.0, approved, #13959 nuget/nuget/-/Serilog.Enrichers.Process/2.0.2, Apache-2.0, approved, clearlydefined nuget/nuget/-/Serilog.Enrichers.Sensitive/1.7.3, MIT, approved, clearlydefined nuget/nuget/-/Serilog.Enrichers.Thread/3.1.0, Apache-2.0, approved, clearlydefined -nuget/nuget/-/Serilog.Extensions.Hosting/7.0.0, Apache-2.0, approved, #10078 -nuget/nuget/-/Serilog.Extensions.Logging/7.0.0, Apache-2.0, approved, #10070 -nuget/nuget/-/Serilog.Formatting.Compact/1.1.0, Apache-2.0, approved, #11115 -nuget/nuget/-/Serilog.Settings.Configuration/7.0.0, Apache-2.0, approved, #10069 -nuget/nuget/-/Serilog.Sinks.Console/4.1.0, Apache-2.0, approved, #8434 +nuget/nuget/-/Serilog.Extensions.Hosting/8.0.0, Apache-2.0, approved, #13962 +nuget/nuget/-/Serilog.Extensions.Logging/8.0.0, Apache-2.0, approved, #13985 +nuget/nuget/-/Serilog.Formatting.Compact/2.0.0, Apache-2.0, approved, #13981 +nuget/nuget/-/Serilog.Settings.Configuration/8.0.0, Apache-2.0, approved, #13988 +nuget/nuget/-/Serilog.Sinks.Console/5.0.1, Apache-2.0, approved, #13980 nuget/nuget/-/Serilog.Sinks.Debug/2.0.0, Apache-2.0, approved, clearlydefined nuget/nuget/-/Serilog.Sinks.File/5.0.0, Apache-2.0, approved, #11116 -nuget/nuget/-/Serilog/3.0.1, Apache-2.0, approved, #10063 +nuget/nuget/-/Serilog/3.1.1, Apache-2.0, approved, #13978 nuget/nuget/-/SharpZipLib/1.4.2, MIT AND GFDL-1.3-or-later AND (Apache-2.0 AND MIT) AND WTFPL AND bzip2-1.0.6 AND LicenseRef-Permissive-license-with-conditions AND LicenseRef-Permission-Notice, approved, #10058 nuget/nuget/-/SshNet.Security.Cryptography/1.3.0, MIT, approved, clearlydefined nuget/nuget/-/Swashbuckle.AspNetCore.Swagger/6.5.0, MIT AND Apache-2.0, approved, #7160 @@ -44,7 +43,6 @@ nuget/nuget/-/Swashbuckle.AspNetCore/6.5.0, MIT AND Apache-2.0, approved, #7159 nuget/nuget/-/Testcontainers.PostgreSql/3.4.0, MIT, approved, #10056 nuget/nuget/-/Testcontainers/3.4.0, MIT, approved, #10083 nuget/nuget/-/Xunit.Extensions.AssemblyFixture/2.4.1, MIT, approved, #3502 -nuget/nuget/-/coverlet.collector/6.0.0, MIT, approved, #10075 nuget/nuget/-/xunit.abstractions/2.0.3, Apache-2.0, approved, clearlydefined nuget/nuget/-/xunit.analyzers/1.2.0, Apache-2.0 AND MIT, approved, #10068 nuget/nuget/-/xunit.assert/2.5.0, Apache-2.0 AND MIT, approved, #10071 diff --git a/README.md b/README.md index a1e81d58..9e60314f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository contains the backend code for the SSI Credential Issuer written ## How to build and run -Install the [.NET 7.0 SDK](https://www.microsoft.com/net/download). +Install the [.NET 8.0 SDK](https://www.microsoft.com/net/download). Run the following command from the CLI: diff --git a/docker/Dockerfile-credential-expiry-app b/docker/Dockerfile-credential-expiry-app index 7749fff2..cd0e954f 100644 --- a/docker/Dockerfile-credential-expiry-app +++ b/docker/Dockerfile-credential-expiry-app @@ -17,9 +17,9 @@ # SPDX-License-Identifier: Apache-2.0 ############################################################### -FROM mcr.microsoft.com/dotnet/runtime:7.0-alpine AS base +FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS base -FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine-amd64 AS publish +FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine-amd64 AS publish WORKDIR / COPY LICENSE NOTICE.md DEPENDENCIES / COPY src/ src/ diff --git a/docker/Dockerfile-credential-issuer-migrations b/docker/Dockerfile-credential-issuer-migrations index c5fb1365..4ad007e7 100644 --- a/docker/Dockerfile-credential-issuer-migrations +++ b/docker/Dockerfile-credential-issuer-migrations @@ -17,9 +17,9 @@ # SPDX-License-Identifier: Apache-2.0 ############################################################### -FROM mcr.microsoft.com/dotnet/runtime:7.0-alpine AS base +FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS base -FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine-amd64 AS publish +FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine-amd64 AS publish WORKDIR / COPY LICENSE NOTICE.md DEPENDENCIES / COPY /src/database /src/database diff --git a/docker/Dockerfile-credential-issuer-processes-worker b/docker/Dockerfile-credential-issuer-processes-worker index d61ff7a7..5e637206 100644 --- a/docker/Dockerfile-credential-issuer-processes-worker +++ b/docker/Dockerfile-credential-issuer-processes-worker @@ -17,9 +17,9 @@ # SPDX-License-Identifier: Apache-2.0 ############################################################### -FROM mcr.microsoft.com/dotnet/runtime:7.0-alpine AS base +FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS base -FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine-amd64 AS publish +FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine-amd64 AS publish WORKDIR / COPY LICENSE NOTICE.md DEPENDENCIES / COPY src/ src/ diff --git a/docker/Dockerfile-credential-issuer-service b/docker/Dockerfile-credential-issuer-service index 6747b1e0..37470114 100644 --- a/docker/Dockerfile-credential-issuer-service +++ b/docker/Dockerfile-credential-issuer-service @@ -17,9 +17,9 @@ # SPDX-License-Identifier: Apache-2.0 ############################################################### -FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base -FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine-amd64 AS publish +FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine-amd64 AS publish WORKDIR / COPY LICENSE NOTICE.md DEPENDENCIES / COPY src/ src/ diff --git a/docker/notice-credential-expiry-app.md b/docker/notice-credential-expiry-app.md index 2273a4a3..b1b48184 100644 --- a/docker/notice-credential-expiry-app.md +++ b/docker/notice-credential-expiry-app.md @@ -13,7 +13,7 @@ __Credential Expiry App__ __Used base images__ -- Dockerfile: [mcr.microsoft.com/dotnet/runtime:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/7.0/alpine3.19/amd64/Dockerfile) +- Dockerfile: [mcr.microsoft.com/dotnet/runtime:8.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/8.0/alpine3.19/amd64/Dockerfile) - GitHub project: [https://github.com/dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) - DockerHub: [https://hub.docker.com/_/microsoft-dotnet-runtime](https://hub.docker.com/_/microsoft-dotnet-runtime) diff --git a/docker/notice-credential-issuer-migrations.md b/docker/notice-credential-issuer-migrations.md index 384c6a01..d3c54858 100644 --- a/docker/notice-credential-issuer-migrations.md +++ b/docker/notice-credential-issuer-migrations.md @@ -13,7 +13,7 @@ __Credential Issuer Migrations__ __Used base images__ -- Dockerfile: [mcr.microsoft.com/dotnet/runtime:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/7.0/alpine3.19/amd64/Dockerfile) +- Dockerfile: [mcr.microsoft.com/dotnet/runtime:8.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/8.0/alpine3.19/amd64/Dockerfile) - GitHub project: [https://github.com/dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) - DockerHub: [https://hub.docker.com/_/microsoft-dotnet-runtime](https://hub.docker.com/_/microsoft-dotnet-runtime) diff --git a/docker/notice-credential-issuer-processes-worker.md b/docker/notice-credential-issuer-processes-worker.md index 11c091ed..a4684fc5 100644 --- a/docker/notice-credential-issuer-processes-worker.md +++ b/docker/notice-credential-issuer-processes-worker.md @@ -13,7 +13,7 @@ Issuer Checklist Worker__ __Used base images__ -- Dockerfile: [mcr.microsoft.com/dotnet/runtime:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/7.0/alpine3.17/amd64/Dockerfile) +- Dockerfile: [mcr.microsoft.com/dotnet/runtime:8.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/runtime/8.0/alpine3.17/amd64/Dockerfile) - GitHub project: [https://github.com/dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) - DockerHub: [https://hub.docker.com/_/microsoft-dotnet-runtime](https://hub.docker.com/_/microsoft-dotnet-runtime) diff --git a/docker/notice-credential-issuer-service.md b/docker/notice-credential-issuer-service.md index 138a4597..baa55a8e 100644 --- a/docker/notice-credential-issuer-service.md +++ b/docker/notice-credential-issuer-service.md @@ -13,7 +13,7 @@ __Policy Hub Service__ __Used base images__ -- Dockerfile: [mcr.microsoft.com/dotnet/aspnet:7.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/aspnet/7.0/alpine3.19/amd64/Dockerfile) +- Dockerfile: [mcr.microsoft.com/dotnet/aspnet:8.0-alpine](https://github.com/dotnet/dotnet-docker/blob/main/src/aspnet/8.0/alpine3.19/amd64/Dockerfile) - GitHub project: [https://github.com/dotnet/dotnet-docker](https://github.com/dotnet/dotnet-docker) - DockerHub: [https://hub.docker.com/_/microsoft-dotnet-aspnet](https://hub.docker.com/_/microsoft-dotnet-aspnet) diff --git a/src/credentials/SsiCredentialIssuer.Expiry.App/ExpiryCheckService.cs b/src/credentials/SsiCredentialIssuer.Expiry.App/ExpiryCheckService.cs index 106e0cbf..96460a25 100644 --- a/src/credentials/SsiCredentialIssuer.Expiry.App/ExpiryCheckService.cs +++ b/src/credentials/SsiCredentialIssuer.Expiry.App/ExpiryCheckService.cs @@ -88,7 +88,7 @@ public async Task ExecuteAsync(CancellationToken stoppingToken) .GetExpiryData(now, inactiveVcsToDelete, expiredVcsToDelete); await foreach (var credential in credentials.WithCancellation(stoppingToken).ConfigureAwait(false)) { - await ProcessCredentials(credential, companySsiDetailsRepository, repositories, portalService, processStepRepository, stoppingToken).ConfigureAwait(false); + await ProcessCredentials(credential, companySsiDetailsRepository, repositories, portalService, processStepRepository, stoppingToken).ConfigureAwait(ConfigureAwaitOptions.None); } } catch (Exception ex) @@ -121,7 +121,7 @@ private static async Task ProcessCredentials( } // Saving here to make sure the each credential is handled by there own - await repositories.SaveAsync().ConfigureAwait(false); + await repositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None); } private static void HandleDecline( @@ -178,7 +178,7 @@ private static async ValueTask HandleNotification( if (Guid.TryParse(data.RequesterId, out var requesterId)) { await portalService.AddNotification(content, requesterId, NotificationTypeId.CREDENTIAL_EXPIRY, - cancellationToken).ConfigureAwait(false); + cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var typeValue = data.VerifiedCredentialTypeId.GetEnumValue() ?? throw new UnexpectedConditionException( $"VerifiedCredentialType {data.VerifiedCredentialTypeId} does not exists"); @@ -188,7 +188,7 @@ await portalService.AddNotification(content, requesterId, NotificationTypeId.CRE new("expiryDate", data.ExpiryDate?.ToString("dd MMMM yyyy") ?? throw new ConflictException("Expiry Date must be set here")) }; - await portalService.TriggerMail("CredentialExpiry", requesterId, mailParameters, cancellationToken).ConfigureAwait(false); + await portalService.TriggerMail("CredentialExpiry", requesterId, mailParameters, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); } } } diff --git a/src/credentials/SsiCredentialIssuer.Expiry.App/Program.cs b/src/credentials/SsiCredentialIssuer.Expiry.App/Program.cs index b6bdd269..b440d12f 100644 --- a/src/credentials/SsiCredentialIssuer.Expiry.App/Program.cs +++ b/src/credentials/SsiCredentialIssuer.Expiry.App/Program.cs @@ -57,7 +57,7 @@ Log.Information("Start processing"); var workerInstance = host.Services.GetRequiredService(); - await workerInstance.ExecuteAsync(tokenSource.Token).ConfigureAwait(false); + await workerInstance.ExecuteAsync(tokenSource.Token).ConfigureAwait(ConfigureAwaitOptions.None); Log.Information("Execution finished shutting down"); } catch (Exception ex) when (!ex.GetType().Name.Equals("StopTheHostException", StringComparison.Ordinal)) diff --git a/src/credentials/SsiCredentialIssuer.Expiry.App/SsiCredentialIssuer.Expiry.App.csproj b/src/credentials/SsiCredentialIssuer.Expiry.App/SsiCredentialIssuer.Expiry.App.csproj index 45ffe379..29be6971 100644 --- a/src/credentials/SsiCredentialIssuer.Expiry.App/SsiCredentialIssuer.Expiry.App.csproj +++ b/src/credentials/SsiCredentialIssuer.Expiry.App/SsiCredentialIssuer.Expiry.App.csproj @@ -22,7 +22,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Expiry.App Org.Eclipse.TractusX.SsiCredentialIssuer.Expiry.App - net7.0 + net8.0 enable enable 37a22764-0a60-4c2e-a692-d59c4f14abbf @@ -33,18 +33,18 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - + + + + + + + + diff --git a/src/database/SsiCredentialIssuer.DbAccess/SsiCredentialIssuer.DbAccess.csproj b/src/database/SsiCredentialIssuer.DbAccess/SsiCredentialIssuer.DbAccess.csproj index 6cb5fa65..30cdd933 100644 --- a/src/database/SsiCredentialIssuer.DbAccess/SsiCredentialIssuer.DbAccess.csproj +++ b/src/database/SsiCredentialIssuer.DbAccess/SsiCredentialIssuer.DbAccess.csproj @@ -21,22 +21,19 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.DBAccess Org.Eclipse.TractusX.SsiCredentialIssuer.DBAccess - net7.0 + net8.0 enable enable - - + + + - - - - diff --git a/src/database/SsiCredentialIssuer.Entities/SsiCredentialIssuer.Entities.csproj b/src/database/SsiCredentialIssuer.Entities/SsiCredentialIssuer.Entities.csproj index 6d397738..56ad10c5 100644 --- a/src/database/SsiCredentialIssuer.Entities/SsiCredentialIssuer.Entities.csproj +++ b/src/database/SsiCredentialIssuer.Entities/SsiCredentialIssuer.Entities.csproj @@ -21,22 +21,22 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Entities Org.Eclipse.TractusX.SsiCredentialIssuer.Entities - net7.0 + net8.0 enable enable - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - + + + + + diff --git a/src/database/SsiCredentialIssuer.Migrations/Seeder/BatchInsertSeeder.cs b/src/database/SsiCredentialIssuer.Migrations/Seeder/BatchInsertSeeder.cs index 0c59abf8..dc841bbb 100644 --- a/src/database/SsiCredentialIssuer.Migrations/Seeder/BatchInsertSeeder.cs +++ b/src/database/SsiCredentialIssuer.Migrations/Seeder/BatchInsertSeeder.cs @@ -62,35 +62,35 @@ public async Task ExecuteAsync(CancellationToken cancellationToken) _logger.LogInformation("Start BaseEntityBatch Seeder"); await SeedBaseEntity(cancellationToken); - await SeedTable("company_ssi_process_datas", x => x.CompanySsiDetailId, cancellationToken).ConfigureAwait(false); - await SeedTable("verified_credential_type_assigned_kinds", x => new { x.VerifiedCredentialTypeId, x.VerifiedCredentialTypeKindId }, cancellationToken).ConfigureAwait(false); - await SeedTable("verified_credential_type_assigned_use_cases", x => new { x.VerifiedCredentialTypeId, x.UseCaseId }, cancellationToken).ConfigureAwait(false); - await SeedTable("verified_credential_type_assigned_external_types", x => new { x.VerifiedCredentialTypeId, x.VerifiedCredentialExternalTypeId }, cancellationToken).ConfigureAwait(false); + await SeedTable("company_ssi_process_datas", x => x.CompanySsiDetailId, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await SeedTable("verified_credential_type_assigned_kinds", x => new { x.VerifiedCredentialTypeId, x.VerifiedCredentialTypeKindId }, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await SeedTable("verified_credential_type_assigned_use_cases", x => new { x.VerifiedCredentialTypeId, x.UseCaseId }, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await SeedTable("verified_credential_type_assigned_external_types", x => new { x.VerifiedCredentialTypeId, x.VerifiedCredentialExternalTypeId }, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); - await _context.SaveChangesAsync(cancellationToken).ConfigureAwait(false); + await _context.SaveChangesAsync(cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); _logger.LogInformation("Finished BaseEntityBatch Seeder"); } private async Task SeedBaseEntity(CancellationToken cancellationToken) { - await SeedTableForBaseEntity("documents", cancellationToken).ConfigureAwait(false); - await SeedTableForBaseEntity("use_cases", cancellationToken).ConfigureAwait(false); - await SeedTableForBaseEntity("process_steps", cancellationToken).ConfigureAwait(false); - await SeedTableForBaseEntity("processes", cancellationToken).ConfigureAwait(false); - await SeedTableForBaseEntity("verified_credential_external_type_detail_versions", cancellationToken).ConfigureAwait(false); - await SeedTableForBaseEntity("company_ssi_details", cancellationToken).ConfigureAwait(false); + await SeedTableForBaseEntity("documents", cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await SeedTableForBaseEntity("use_cases", cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await SeedTableForBaseEntity("process_steps", cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await SeedTableForBaseEntity("processes", cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await SeedTableForBaseEntity("verified_credential_external_type_detail_versions", cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await SeedTableForBaseEntity("company_ssi_details", cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); } private async Task SeedTableForBaseEntity(string fileName, CancellationToken cancellationToken) where T : class, IBaseEntity { - await SeedTable(fileName, x => x.Id, cancellationToken).ConfigureAwait(false); + await SeedTable(fileName, x => x.Id, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); } private async Task SeedTable(string fileName, Func keySelector, CancellationToken cancellationToken) where T : class { _logger.LogInformation("Start seeding {Filename}", fileName); var additionalEnvironments = _settings.TestDataEnvironments ?? Enumerable.Empty(); - var data = await SeederHelper.GetSeedData(_logger, fileName, _settings.DataPaths, cancellationToken, additionalEnvironments.ToArray()).ConfigureAwait(false); + var data = await SeederHelper.GetSeedData(_logger, fileName, _settings.DataPaths, cancellationToken, additionalEnvironments.ToArray()).ConfigureAwait(ConfigureAwaitOptions.None); _logger.LogInformation("Found {ElementCount} data", data.Count); if (data.Any()) { @@ -101,7 +101,7 @@ private async Task SeedTable(string fileName, Func keySelector, Ca .Where(t => t.x == null) .Select(t => t.t.d).ToList(); _logger.LogInformation("Seeding {DataCount} {TableName}", data.Count, typeName); - await _context.Set().AddRangeAsync(data, cancellationToken).ConfigureAwait(false); + await _context.Set().AddRangeAsync(data, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); _logger.LogInformation("Seeded {TableName}", typeName); } } diff --git a/src/database/SsiCredentialIssuer.Migrations/Seeder/BatchUpdateSeeder.cs b/src/database/SsiCredentialIssuer.Migrations/Seeder/BatchUpdateSeeder.cs index 3fcc80a4..e42a5a43 100644 --- a/src/database/SsiCredentialIssuer.Migrations/Seeder/BatchUpdateSeeder.cs +++ b/src/database/SsiCredentialIssuer.Migrations/Seeder/BatchUpdateSeeder.cs @@ -69,9 +69,9 @@ await SeedTable("verified_credentia dbEntry.Template = entry.Template; dbEntry.Expiry = entry.Expiry; dbEntry.ValidFrom = entry.ValidFrom; - }, cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); - await _context.SaveChangesAsync(cancellationToken).ConfigureAwait(false); + await _context.SaveChangesAsync(cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); _logger.LogInformation("Finished BaseEntityBatch Seeder"); } @@ -79,7 +79,7 @@ private async Task SeedTable(string fileName, Func keySelector, Fu { _logger.LogInformation("Start seeding {Filename}", fileName); var additionalEnvironments = _settings.TestDataEnvironments ?? Enumerable.Empty(); - var data = await SeederHelper.GetSeedData(_logger, fileName, _settings.DataPaths, cancellationToken, additionalEnvironments.ToArray()).ConfigureAwait(false); + var data = await SeederHelper.GetSeedData(_logger, fileName, _settings.DataPaths, cancellationToken, additionalEnvironments.ToArray()).ConfigureAwait(ConfigureAwaitOptions.None); _logger.LogInformation("Found {ElementCount} data", data.Count); if (data.Any()) { diff --git a/src/database/SsiCredentialIssuer.Migrations/SsiCredentialIssuer.Migrations.csproj b/src/database/SsiCredentialIssuer.Migrations/SsiCredentialIssuer.Migrations.csproj index 7741e998..9129390e 100644 --- a/src/database/SsiCredentialIssuer.Migrations/SsiCredentialIssuer.Migrations.csproj +++ b/src/database/SsiCredentialIssuer.Migrations/SsiCredentialIssuer.Migrations.csproj @@ -21,7 +21,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Migrations Org.Eclipse.TractusX.SsiCredentialIssuer.Migrations - net7.0 + net8.0 enable enable 31645f70-6335-4833-b3b4-4826ca778084 @@ -33,23 +33,24 @@ true - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/externalservices/Callback.Service/Callback.Service.csproj b/src/externalservices/Callback.Service/Callback.Service.csproj index 6f0c33d9..e748e4c2 100644 --- a/src/externalservices/Callback.Service/Callback.Service.csproj +++ b/src/externalservices/Callback.Service/Callback.Service.csproj @@ -22,15 +22,15 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Callback.Service Org.Eclipse.TractusX.SsiCredentialIssuer.Callback.Service - net7.0 + net8.0 enable enable - - - + + + diff --git a/src/externalservices/Callback.Service/Services/CallbackService.cs b/src/externalservices/Callback.Service/Services/CallbackService.cs index 719f3609..8a10610c 100644 --- a/src/externalservices/Callback.Service/Services/CallbackService.cs +++ b/src/externalservices/Callback.Service/Services/CallbackService.cs @@ -47,7 +47,7 @@ public CallbackService(ITokenService tokenService, IOptions op public async Task TriggerCallback(string callbackUrl, IssuerResponseData responseData, CancellationToken cancellationToken) { - var client = await _tokenService.GetAuthorizedClient(_settings, cancellationToken).ConfigureAwait(false); + var client = await _tokenService.GetAuthorizedClient(_settings, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); await client.PostAsJsonAsync($"{callbackUrl}", responseData, Options, cancellationToken) .CatchingIntoServiceExceptionFor("callback", HttpAsyncResponseMessageExtension.RecoverOptions.REQUEST_EXCEPTION) .ConfigureAwait(false); diff --git a/src/externalservices/Portal.Service/Portal.Service.csproj b/src/externalservices/Portal.Service/Portal.Service.csproj index 76ede424..4091ad85 100644 --- a/src/externalservices/Portal.Service/Portal.Service.csproj +++ b/src/externalservices/Portal.Service/Portal.Service.csproj @@ -22,15 +22,15 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Portal.Service Org.Eclipse.TractusX.SsiCredentialIssuer.Portal.Service - net7.0 + net8.0 enable enable - - - + + + diff --git a/src/externalservices/Portal.Service/Services/PortalService.cs b/src/externalservices/Portal.Service/Services/PortalService.cs index 6160047e..3f0dc27c 100644 --- a/src/externalservices/Portal.Service/Services/PortalService.cs +++ b/src/externalservices/Portal.Service/Services/PortalService.cs @@ -42,7 +42,7 @@ public PortalService(ITokenService tokenService, IOptions option public async Task AddNotification(string content, Guid requester, NotificationTypeId notificationTypeId, CancellationToken cancellationToken) { - using var client = await _tokenService.GetAuthorizedClient(_settings, cancellationToken).ConfigureAwait(false); + using var client = await _tokenService.GetAuthorizedClient(_settings, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var data = new NotificationRequest(requester, content, notificationTypeId); await client.PostAsJsonAsync("api/notifications/ssi-credentials", data, Options, cancellationToken) .CatchingIntoServiceExceptionFor("notification", HttpAsyncResponseMessageExtension.RecoverOptions.REQUEST_EXCEPTION) @@ -51,7 +51,7 @@ await client.PostAsJsonAsync("api/notifications/ssi-credentials", data, Options, public async Task TriggerMail(string template, Guid requester, IEnumerable mailParameters, CancellationToken cancellationToken) { - using var client = await _tokenService.GetAuthorizedClient(_settings, cancellationToken).ConfigureAwait(false); + using var client = await _tokenService.GetAuthorizedClient(_settings, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var data = new MailData(requester, template, mailParameters); await client.PostAsJsonAsync("api/administration/mail/ssi-credentials", data, Options, cancellationToken) .CatchingIntoServiceExceptionFor("mail", HttpAsyncResponseMessageExtension.RecoverOptions.REQUEST_EXCEPTION) diff --git a/src/externalservices/Wallet.Service/BusinessLogic/WalletBusinessLogic.cs b/src/externalservices/Wallet.Service/BusinessLogic/WalletBusinessLogic.cs index 4695c193..cc88f181 100644 --- a/src/externalservices/Wallet.Service/BusinessLogic/WalletBusinessLogic.cs +++ b/src/externalservices/Wallet.Service/BusinessLogic/WalletBusinessLogic.cs @@ -48,25 +48,25 @@ public WalletBusinessLogic(IWalletService walletService, IIssuerRepositories rep public async Task CreateCredential(Guid companySsiDetailId, JsonDocument schema, CancellationToken cancellationToken) { - var credentialId = await _walletService.CreateCredential(schema, cancellationToken).ConfigureAwait(false); + var credentialId = await _walletService.CreateCredential(schema, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); _repositories.GetInstance().AttachAndModifyCompanySsiDetails(companySsiDetailId, c => c.ExternalCredentialId = null, c => c.ExternalCredentialId = credentialId); } public async Task SignCredential(Guid companySsiDetailId, Guid credentialId, CancellationToken cancellationToken) { - var credential = await _walletService.SignCredential(credentialId, cancellationToken).ConfigureAwait(false); + var credential = await _walletService.SignCredential(credentialId, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); _repositories.GetInstance().AttachAndModifyCompanySsiDetails(companySsiDetailId, c => c.Credential = null, c => c.Credential = credential); } public async Task GetCredential(Guid credentialId, Guid externalCredentialId, VerifiedCredentialTypeKindId kindId, CancellationToken cancellationToken) { - var credential = await _walletService.GetCredential(externalCredentialId, cancellationToken).ConfigureAwait(false); - await ValidateSchema(kindId, credential, cancellationToken).ConfigureAwait(false); + var credential = await _walletService.GetCredential(externalCredentialId, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await ValidateSchema(kindId, credential, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); using var stream = new MemoryStream(); using var writer = new Utf8JsonWriter(stream, new JsonWriterOptions { Indented = true }); credential.WriteTo(writer); - await writer.FlushAsync(cancellationToken).ConfigureAwait(false); + await writer.FlushAsync(cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var documentContent = stream.ToArray(); var hash = SHA512.HashData(documentContent); var documentRepository = _repositories.GetInstance(); @@ -83,7 +83,7 @@ private static async Task ValidateSchema(VerifiedCredentialTypeKindId kindId, Js } var path = Path.Combine(location, "Schemas", $"{kindId}Credential.schema.json"); - var schemaJson = await File.ReadAllTextAsync(path, cancellationToken).ConfigureAwait(false); + var schemaJson = await File.ReadAllTextAsync(path, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var schema = JsonSchema.FromText(schemaJson); SchemaRegistry.Global.Register(schema); @@ -101,7 +101,7 @@ public async Task CreateCredentialForHolder(Guid companySsiDetailId, string hold await _walletService .CreateCredentialForHolder(holderWalletUrl, clientId, secret, credential, cancellationToken) - .ConfigureAwait(false); + .ConfigureAwait(ConfigureAwaitOptions.None); _repositories.GetInstance().AttachAndModifyProcessData(companySsiDetailId, c => diff --git a/src/externalservices/Wallet.Service/DependencyInjection/WalletSettings.cs b/src/externalservices/Wallet.Service/DependencyInjection/WalletSettings.cs index ca1f17cc..ba5ad63f 100644 --- a/src/externalservices/Wallet.Service/DependencyInjection/WalletSettings.cs +++ b/src/externalservices/Wallet.Service/DependencyInjection/WalletSettings.cs @@ -18,6 +18,7 @@ ********************************************************************************/ using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Configuration; +using Org.Eclipse.TractusX.Portal.Backend.Framework.Token; using Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service.Services; using System.ComponentModel.DataAnnotations; diff --git a/src/externalservices/Wallet.Service/Services/BasicAuthSettings.cs b/src/externalservices/Wallet.Service/Services/BasicAuthSettings.cs deleted file mode 100644 index 3589d2c0..00000000 --- a/src/externalservices/Wallet.Service/Services/BasicAuthSettings.cs +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2024 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -using System.ComponentModel.DataAnnotations; - -namespace Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service.Services; - -public class BasicAuthSettings -{ - [Required(AllowEmptyStrings = false)] - public string ClientId { get; set; } = null!; - - [Required(AllowEmptyStrings = false)] - public string ClientSecret { get; set; } = null!; - - [Required(AllowEmptyStrings = false)] - public string TokenAddress { get; set; } = null!; -} - -public record GetBasicTokenSettings(string HttpClientName, string ClientId, string ClientSecret, string TokenAddress); diff --git a/src/externalservices/Wallet.Service/Services/BasicAuthTokenService.cs b/src/externalservices/Wallet.Service/Services/BasicAuthTokenService.cs index a3d90473..e38d8652 100644 --- a/src/externalservices/Wallet.Service/Services/BasicAuthTokenService.cs +++ b/src/externalservices/Wallet.Service/Services/BasicAuthTokenService.cs @@ -42,9 +42,10 @@ public async Task GetBasicAuthorizedClient(BasicAuthSettings sett $"{typeof(T).Name}Auth", settings.ClientId, settings.ClientSecret, - settings.TokenAddress); + settings.TokenAddress, + "client_credentials"); - var token = await GetBasicTokenAsync(tokenParameters, cancellationToken).ConfigureAwait(false); + var token = await GetBasicTokenAsync(tokenParameters, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var httpClient = _httpClientFactory.CreateClient(typeof(T).Name); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); @@ -55,7 +56,7 @@ public async Task GetBasicAuthorizedClient(BasicAuthSettings sett { var formParameters = new Dictionary { - { "grant_type", "client_credentials" } + { "grant_type", settings.GrantType } }; using var content = new FormUrlEncodedContent(formParameters); using var authClient = _httpClientFactory.CreateClient(settings.HttpClientName); @@ -67,7 +68,7 @@ public async Task GetBasicAuthorizedClient(BasicAuthSettings sett var response = await authClient.PostAsync(settings.TokenAddress, content, cancellationToken) .CatchingIntoServiceExceptionFor("token-post", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE).ConfigureAwait(false); - var responseObject = await response.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(false); + var responseObject = await response.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); return responseObject?.AccessToken; } } diff --git a/src/externalservices/Wallet.Service/Services/IBasicAuthTokenService.cs b/src/externalservices/Wallet.Service/Services/IBasicAuthTokenService.cs index 693cd234..f8f92c17 100644 --- a/src/externalservices/Wallet.Service/Services/IBasicAuthTokenService.cs +++ b/src/externalservices/Wallet.Service/Services/IBasicAuthTokenService.cs @@ -17,6 +17,8 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ +using Org.Eclipse.TractusX.Portal.Backend.Framework.Token; + namespace Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service.Services; public interface IBasicAuthTokenService diff --git a/src/externalservices/Wallet.Service/Services/WalletService.cs b/src/externalservices/Wallet.Service/Services/WalletService.cs index ed69daad..f0a132a7 100644 --- a/src/externalservices/Wallet.Service/Services/WalletService.cs +++ b/src/externalservices/Wallet.Service/Services/WalletService.cs @@ -20,6 +20,7 @@ using Microsoft.Extensions.Options; using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling; using Org.Eclipse.TractusX.Portal.Backend.Framework.HttpClientExtensions; +using Org.Eclipse.TractusX.Portal.Backend.Framework.Token; using Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service.DependencyInjection; using Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service.Models; using System.Net.Http.Json; @@ -47,9 +48,9 @@ public async Task CreateCredential(JsonDocument payload, CancellationToken var data = new CreateCredentialRequest("catena-x-portal", new CredentialPayload(payload)); var result = await client.PostAsJsonAsync("api/v2.0.0/credentials", data, Options, cancellationToken) .CatchingIntoServiceExceptionFor("create-credential", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE, - async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(false))) + async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(ConfigureAwaitOptions.None))) .ConfigureAwait(false); - var response = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(false); + var response = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); if (response == null) { throw new ConflictException(NoIdErrorMessage); @@ -64,9 +65,9 @@ public async Task SignCredential(Guid credentialId, CancellationToken ca var data = new SignCredentialRequest(new SignPayload(new SignUpdate("external", "jwt"))); var result = await client.PatchAsJsonAsync($"/api/v2.0.0/credentials/{credentialId}", data, Options, cancellationToken) .CatchingIntoServiceExceptionFor("sign-credential", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE, - async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(false))) + async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(ConfigureAwaitOptions.None))) .ConfigureAwait(false); - var response = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(false); + var response = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); if (response is null) { throw new ServiceException(NoIdErrorMessage, true); @@ -80,9 +81,9 @@ public async Task GetCredential(Guid externalCredentialId, Cancell using var client = await _basicAuthTokenService.GetBasicAuthorizedClient(_settings, cancellationToken); var result = await client.GetAsync($"/api/v2.0.0/credentials/{externalCredentialId}", cancellationToken) .CatchingIntoServiceExceptionFor("get-credential", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE, - async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(false))) + async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(ConfigureAwaitOptions.None))) .ConfigureAwait(false); - var response = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(false); + var response = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); if (response is null) { throw new ServiceException(NoIdErrorMessage, true); @@ -103,9 +104,9 @@ public async Task CreateCredentialForHolder(string holderWalletUrl, string var data = new DeriveCredentialData("catena-x-portal", new DeriveCredentialPayload(new DeriveCredential(credential))); var result = await client.PostAsJsonAsync("/api/v2.0.0/credentials", data, Options, cancellationToken) .CatchingIntoServiceExceptionFor("create-holder-credential", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE, - async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(false))) + async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(ConfigureAwaitOptions.None))) .ConfigureAwait(false); - var response = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(false); + var response = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); if (response is null) { throw new ServiceException(NoIdErrorMessage, true); @@ -120,7 +121,7 @@ public async Task RevokeCredentialForIssuer(Guid externalCredentialId, Cancellat var data = new RevokeCredentialRequest(new RevokePayload(true)); await client.PatchAsJsonAsync($"/api/v2.0.0/credentials/{externalCredentialId}", data, Options, cancellationToken) .CatchingIntoServiceExceptionFor("revoke-credential", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE, - async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(false))) + async x => (false, await x.Content.ReadAsStringAsync().ConfigureAwait(ConfigureAwaitOptions.None))) .ConfigureAwait(false); } } diff --git a/src/externalservices/Wallet.Service/Wallet.Service.csproj b/src/externalservices/Wallet.Service/Wallet.Service.csproj index 64436a01..d1e6720b 100644 --- a/src/externalservices/Wallet.Service/Wallet.Service.csproj +++ b/src/externalservices/Wallet.Service/Wallet.Service.csproj @@ -21,7 +21,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service - net7.0 + net8.0 enable enable @@ -30,11 +30,11 @@ - - - - - + + + + + diff --git a/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/CredentialBusinessLogic.cs b/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/CredentialBusinessLogic.cs index ab533261..cc43ebae 100644 --- a/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/CredentialBusinessLogic.cs +++ b/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/CredentialBusinessLogic.cs @@ -39,7 +39,7 @@ public CredentialBusinessLogic(IIssuerRepositories repositories, IIdentityServic public async Task GetCredentialDocument(Guid credentialId) { - var (exists, isSameCompany, documents) = await _repositories.GetInstance().GetSignedCredentialForCredentialId(credentialId, _identityData.Bpnl).ConfigureAwait(false); + var (exists, isSameCompany, documents) = await _repositories.GetInstance().GetSignedCredentialForCredentialId(credentialId, _identityData.Bpnl).ConfigureAwait(ConfigureAwaitOptions.None); if (!exists) { throw NotFoundException.Create(CredentialErrors.CREDENTIAL_NOT_FOUND, new[] { new ErrorParameter("credentialId", credentialId.ToString()) }); @@ -57,6 +57,6 @@ public async Task GetCredentialDocument(Guid credentialId) var (_, credentialContent) = documents.Single(); using var stream = new MemoryStream(credentialContent); - return await JsonDocument.ParseAsync(stream).ConfigureAwait(false); + return await JsonDocument.ParseAsync(stream).ConfigureAwait(ConfigureAwaitOptions.None); } } diff --git a/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/IssuerBusinessLogic.cs b/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/IssuerBusinessLogic.cs index bcf99ad8..39423d0c 100644 --- a/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/IssuerBusinessLogic.cs +++ b/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/IssuerBusinessLogic.cs @@ -188,7 +188,7 @@ public async Task ApproveCredential(Guid credentialId, CancellationToken cancell } var companySsiRepository = _repositories.GetInstance(); - var (exists, data) = await companySsiRepository.GetSsiApprovalData(credentialId).ConfigureAwait(false); + var (exists, data) = await companySsiRepository.GetSsiApprovalData(credentialId).ConfigureAwait(ConfigureAwaitOptions.None); ValidateApprovalData(credentialId, exists, data); var processId = CreateProcess(); @@ -215,10 +215,10 @@ public async Task ApproveCredential(Guid credentialId, CancellationToken cancell new("credentialType", typeValue), new("expiryDate", expiry.ToString("o", CultureInfo.InvariantCulture)) }; - await _portalService.TriggerMail("CredentialApproval", _identity.CompanyUserId.Value, mailParameters, cancellationToken).ConfigureAwait(false); + await _portalService.TriggerMail("CredentialApproval", _identity.CompanyUserId.Value, mailParameters, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var content = JsonSerializer.Serialize(new { data.Type, CredentialId = credentialId }, Options); - await _portalService.AddNotification(content, _identity.CompanyUserId.Value, NotificationTypeId.CREDENTIAL_APPROVAL, cancellationToken).ConfigureAwait(false); - await _repositories.SaveAsync().ConfigureAwait(false); + await _portalService.AddNotification(content, _identity.CompanyUserId.Value, NotificationTypeId.CREDENTIAL_APPROVAL, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await _repositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None); } private void UpdateIssuanceDate(Guid credentialId, SsiApprovalData data, @@ -321,7 +321,7 @@ public async Task RejectCredential(Guid credentialId, CancellationToken cancella } var companySsiRepository = _repositories.GetInstance(); - var (exists, status, type, processId, processStepIds) = await companySsiRepository.GetSsiRejectionData(credentialId).ConfigureAwait(false); + var (exists, status, type, processId, processStepIds) = await companySsiRepository.GetSsiRejectionData(credentialId).ConfigureAwait(ConfigureAwaitOptions.None); if (!exists) { throw NotFoundException.Create(IssuerErrors.SSI_DETAILS_NOT_FOUND, new ErrorParameter[] { new("credentialId", credentialId.ToString()) }); @@ -334,7 +334,7 @@ public async Task RejectCredential(Guid credentialId, CancellationToken cancella var typeValue = type.GetEnumValue() ?? throw UnexpectedConditionException.Create(IssuerErrors.CREDENTIAL_TYPE_NOT_FOUND, new ErrorParameter[] { new("verifiedCredentialType", type.ToString()) }); var content = JsonSerializer.Serialize(new { Type = type, CredentialId = credentialId }, Options); - await _portalService.AddNotification(content, _identity.CompanyUserId.Value, NotificationTypeId.CREDENTIAL_REJECTED, cancellationToken).ConfigureAwait(false); + await _portalService.AddNotification(content, _identity.CompanyUserId.Value, NotificationTypeId.CREDENTIAL_REJECTED, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var mailParameters = new MailParameter[] { @@ -342,7 +342,7 @@ public async Task RejectCredential(Guid credentialId, CancellationToken cancella new("reason", "Declined by the Operator") }; - await _portalService.TriggerMail("CredentialRejected", _identity.CompanyUserId.Value, mailParameters, cancellationToken).ConfigureAwait(false); + await _portalService.TriggerMail("CredentialRejected", _identity.CompanyUserId.Value, mailParameters, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); companySsiRepository.AttachAndModifyCompanySsiDetails(credentialId, c => { @@ -364,7 +364,7 @@ public async Task RejectCredential(Guid credentialId, CancellationToken cancella ))); } - await _repositories.SaveAsync().ConfigureAwait(false); + await _repositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None); } /// @@ -374,7 +374,7 @@ public IAsyncEnumerable GetCertificateTypes() => public async Task CreateBpnCredential(CreateBpnCredentialRequest requestData, CancellationToken cancellationToken) { var companyCredentialDetailsRepository = _repositories.GetInstance(); - var holderDid = await GetHolderInformation(requestData.Holder, cancellationToken).ConfigureAwait(false); + var holderDid = await GetHolderInformation(requestData.Holder, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var schemaData = new BpnCredential( Guid.NewGuid(), Context, @@ -401,7 +401,7 @@ public async Task CreateMembershipCredential(CreateMembershipCredentialReq { var companyCredentialDetailsRepository = _repositories.GetInstance(); - var holderDid = await GetHolderInformation(requestData.Holder, cancellationToken).ConfigureAwait(false); + var holderDid = await GetHolderInformation(requestData.Holder, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var schemaData = new MembershipCredential( Guid.NewGuid(), Context, @@ -427,7 +427,7 @@ public async Task CreateMembershipCredential(CreateMembershipCredentialReq public async Task CreateFrameworkCredential(CreateFrameworkCredentialRequest requestData, CancellationToken cancellationToken) { var companyCredentialDetailsRepository = _repositories.GetInstance(); - var result = await companyCredentialDetailsRepository.CheckCredentialTypeIdExistsForExternalTypeDetailVersionId(requestData.UseCaseFrameworkVersionId, requestData.UseCaseFrameworkId).ConfigureAwait(false); + var result = await companyCredentialDetailsRepository.CheckCredentialTypeIdExistsForExternalTypeDetailVersionId(requestData.UseCaseFrameworkVersionId, requestData.UseCaseFrameworkId).ConfigureAwait(ConfigureAwaitOptions.None); if (!result.Exists) { throw ControllerArgumentException.Create(IssuerErrors.EXTERNAL_TYPE_DETAIL_NOT_FOUND, new ErrorParameter[] { new("verifiedCredentialExternalTypeDetailId", requestData.UseCaseFrameworkId.ToString()) }); @@ -459,7 +459,7 @@ public async Task CreateFrameworkCredential(CreateFrameworkCredentialReque throw ControllerArgumentException.Create(IssuerErrors.EMPTY_EXTERNAL_TYPE_ID); } - var holderDid = await GetHolderInformation(requestData.Holder, cancellationToken).ConfigureAwait(false); + var holderDid = await GetHolderInformation(requestData.Holder, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var schemaData = new FrameworkCredential( Guid.NewGuid(), Context, @@ -495,7 +495,7 @@ private async Task GetHolderInformation(string didDocumentLocation, Canc var client = _clientFactory.CreateClient("didDocumentDownload"); var result = await client.GetAsync(uri, cancellationToken) .CatchingIntoServiceExceptionFor("get-did-document").ConfigureAwait(false); - var did = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(false); + var did = await result.Content.ReadFromJsonAsync(Options, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); if (did == null) { throw ConflictException.Create(IssuerErrors.DID_NOT_SET); @@ -564,7 +564,7 @@ private async Task HandleCredentialProcessCreation( c.CallbackUrl = callbackUrl; }); - await _repositories.SaveAsync().ConfigureAwait(false); + await _repositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None); return ssiDetailId; } } diff --git a/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/RevocationBusinessLogic.cs b/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/RevocationBusinessLogic.cs index b63cfdf4..85aef268 100644 --- a/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/RevocationBusinessLogic.cs +++ b/src/issuer/SsiCredentialIssuer.Service/BusinessLogic/RevocationBusinessLogic.cs @@ -45,7 +45,7 @@ public async Task RevokeCredential(Guid credentialId, bool revokeForIssuer, Canc { var credentialRepository = _repositories.GetInstance(); var data = await credentialRepository.GetRevocationDataById(credentialId, _identityData.Bpnl) - .ConfigureAwait(false); + .ConfigureAwait(ConfigureAwaitOptions.None); if (!data.Exists) { throw NotFoundException.Create(RevocationDataErrors.CREDENTIAL_NOT_FOUND, new ErrorParameter[] { new("credentialId", credentialId.ToString()) }); @@ -67,7 +67,7 @@ public async Task RevokeCredential(Guid credentialId, bool revokeForIssuer, Canc } // call walletService - await _walletService.RevokeCredentialForIssuer(data.ExternalCredentialId.Value, cancellationToken).ConfigureAwait(false); + await _walletService.RevokeCredentialForIssuer(data.ExternalCredentialId.Value, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); _repositories.GetInstance().AttachAndModifyDocuments( data.Documents.Select(d => new ValueTuple?, Action>( d.DocumentId, diff --git a/src/issuer/SsiCredentialIssuer.Service/Controllers/IssuerController.cs b/src/issuer/SsiCredentialIssuer.Service/Controllers/IssuerController.cs index b14c3545..584f90bd 100644 --- a/src/issuer/SsiCredentialIssuer.Service/Controllers/IssuerController.cs +++ b/src/issuer/SsiCredentialIssuer.Service/Controllers/IssuerController.cs @@ -143,7 +143,7 @@ public static RouteGroupBuilder MapIssuerApi(this RouteGroupBuilder group) issuer.MapPut("{credentialId}/approval", async ([FromRoute] Guid credentialId, CancellationToken cancellationToken, IIssuerBusinessLogic logic) => { - await logic.ApproveCredential(credentialId, cancellationToken).ConfigureAwait(false); + await logic.ApproveCredential(credentialId, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); return Results.NoContent(); }) .WithSwaggerDescription("Approves the given credential and triggers the verified credential creation", @@ -163,7 +163,7 @@ public static RouteGroupBuilder MapIssuerApi(this RouteGroupBuilder group) issuer.MapPut("{credentialId}/reject", async ([FromRoute] Guid credentialId, CancellationToken cancellationToken, IIssuerBusinessLogic logic) => { - await logic.RejectCredential(credentialId, cancellationToken).ConfigureAwait(false); + await logic.RejectCredential(credentialId, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); return Results.NoContent(); }) .WithSwaggerDescription("Rejects the given credential", diff --git a/src/issuer/SsiCredentialIssuer.Service/SsiCredentialIssuer.Service.csproj b/src/issuer/SsiCredentialIssuer.Service/SsiCredentialIssuer.Service.csproj index fd3e5742..e4d25cee 100644 --- a/src/issuer/SsiCredentialIssuer.Service/SsiCredentialIssuer.Service.csproj +++ b/src/issuer/SsiCredentialIssuer.Service/SsiCredentialIssuer.Service.csproj @@ -22,7 +22,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Service Org.Eclipse.TractusX.SsiCredentialIssuer.Service - net7.0 + net8.0 enable enable 1c25fec6-9663-495e-9c65-3212002d71ab @@ -33,14 +33,14 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/src/processes/CredentialProcess.Library/Creation/CredentialCreationProcessHandler.cs b/src/processes/CredentialProcess.Library/Creation/CredentialCreationProcessHandler.cs index 9ff1588d..e898ea10 100644 --- a/src/processes/CredentialProcess.Library/Creation/CredentialCreationProcessHandler.cs +++ b/src/processes/CredentialProcess.Library/Creation/CredentialCreationProcessHandler.cs @@ -43,8 +43,8 @@ public CredentialCreationProcessHandler(IIssuerRepositories issuerRepositories, public async Task<(IEnumerable? nextStepTypeIds, ProcessStepStatusId stepStatusId, bool modified, string? processMessage)> CreateCredential(Guid credentialId, CancellationToken cancellationToken) { - var data = await _issuerRepositories.GetInstance().GetCredentialStorageInformationById(credentialId).ConfigureAwait(false); - await _walletBusinessLogic.CreateCredential(credentialId, data.Schema, cancellationToken).ConfigureAwait(false); + var data = await _issuerRepositories.GetInstance().GetCredentialStorageInformationById(credentialId).ConfigureAwait(ConfigureAwaitOptions.None); + await _walletBusinessLogic.CreateCredential(credentialId, data.Schema, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); return ( Enumerable.Repeat(ProcessStepTypeId.SIGN_CREDENTIAL, 1), ProcessStepStatusId.DONE, @@ -54,13 +54,13 @@ public CredentialCreationProcessHandler(IIssuerRepositories issuerRepositories, public async Task<(IEnumerable? nextStepTypeIds, ProcessStepStatusId stepStatusId, bool modified, string? processMessage)> SignCredential(Guid credentialId, CancellationToken cancellationToken) { - var externalCredentialId = await _issuerRepositories.GetInstance().GetWalletCredentialId(credentialId).ConfigureAwait(false); + var externalCredentialId = await _issuerRepositories.GetInstance().GetWalletCredentialId(credentialId).ConfigureAwait(ConfigureAwaitOptions.None); if (externalCredentialId is null) { throw new ConflictException("ExternalCredentialId must be set here"); } - await _walletBusinessLogic.SignCredential(credentialId, externalCredentialId!.Value, cancellationToken).ConfigureAwait(false); + await _walletBusinessLogic.SignCredential(credentialId, externalCredentialId!.Value, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); return ( Enumerable.Repeat(ProcessStepTypeId.SAVE_CREDENTIAL_DOCUMENT, 1), ProcessStepStatusId.DONE, @@ -70,13 +70,13 @@ public CredentialCreationProcessHandler(IIssuerRepositories issuerRepositories, public async Task<(IEnumerable? nextStepTypeIds, ProcessStepStatusId stepStatusId, bool modified, string? processMessage)> SaveCredentialDocument(Guid credentialId, CancellationToken cancellationToken) { - var (externalCredentialId, kindId, hasEncryptionInformation, callbackUrl) = await _issuerRepositories.GetInstance().GetExternalCredentialAndKindId(credentialId).ConfigureAwait(false); + var (externalCredentialId, kindId, hasEncryptionInformation, callbackUrl) = await _issuerRepositories.GetInstance().GetExternalCredentialAndKindId(credentialId).ConfigureAwait(ConfigureAwaitOptions.None); if (externalCredentialId == null) { throw new ConflictException("ExternalCredentialId must be set here"); } - await _walletBusinessLogic.GetCredential(credentialId, externalCredentialId.Value, kindId, cancellationToken).ConfigureAwait(false); + await _walletBusinessLogic.GetCredential(credentialId, externalCredentialId.Value, kindId, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); var nextProcessStep = callbackUrl == null ? null : Enumerable.Repeat(ProcessStepTypeId.TRIGGER_CALLBACK, 1); return ( hasEncryptionInformation @@ -89,7 +89,7 @@ public CredentialCreationProcessHandler(IIssuerRepositories issuerRepositories, public async Task<(IEnumerable? nextStepTypeIds, ProcessStepStatusId stepStatusId, bool modified, string? processMessage)> CreateCredentialForHolder(Guid credentialId, CancellationToken cancellationToken) { - var (holderWalletData, credential, encryptionInformation, callbackUrl) = await _issuerRepositories.GetInstance().GetCredentialData(credentialId).ConfigureAwait(false); + var (holderWalletData, credential, encryptionInformation, callbackUrl) = await _issuerRepositories.GetInstance().GetCredentialData(credentialId).ConfigureAwait(ConfigureAwaitOptions.None); if (credential is null) { throw new ConflictException("Credential must be set here"); @@ -105,7 +105,7 @@ public CredentialCreationProcessHandler(IIssuerRepositories issuerRepositories, throw new ConflictException("Wallet secret must be set"); } - await _walletBusinessLogic.CreateCredentialForHolder(credentialId, holderWalletData.WalletUrl, holderWalletData.ClientId, new EncryptionInformation(encryptionInformation.Secret, encryptionInformation.InitializationVector, encryptionInformation.EncryptionMode.Value), credential, cancellationToken).ConfigureAwait(false); + await _walletBusinessLogic.CreateCredentialForHolder(credentialId, holderWalletData.WalletUrl, holderWalletData.ClientId, new EncryptionInformation(encryptionInformation.Secret, encryptionInformation.InitializationVector, encryptionInformation.EncryptionMode.Value), credential, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); return ( callbackUrl is null ? null : Enumerable.Repeat(ProcessStepTypeId.TRIGGER_CALLBACK, 1), ProcessStepStatusId.DONE, @@ -115,14 +115,14 @@ public CredentialCreationProcessHandler(IIssuerRepositories issuerRepositories, public async Task<(IEnumerable? nextStepTypeIds, ProcessStepStatusId stepStatusId, bool modified, string? processMessage)> TriggerCallback(Guid credentialId, CancellationToken cancellationToken) { - var (bpn, callbackUrl) = await _issuerRepositories.GetInstance().GetCallbackUrl(credentialId).ConfigureAwait(false); + var (bpn, callbackUrl) = await _issuerRepositories.GetInstance().GetCallbackUrl(credentialId).ConfigureAwait(ConfigureAwaitOptions.None); if (callbackUrl is null) { throw new ConflictException("CallbackUrl must be set"); } var issuerResponseData = new IssuerResponseData(bpn, IssuerResponseStatus.SUCCESSFUL, "Successfully created Credential"); - await _callbackService.TriggerCallback(callbackUrl, issuerResponseData, cancellationToken).ConfigureAwait(false); + await _callbackService.TriggerCallback(callbackUrl, issuerResponseData, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); return ( null, ProcessStepStatusId.DONE, diff --git a/src/processes/CredentialProcess.Library/CredentialProcess.Library.csproj b/src/processes/CredentialProcess.Library/CredentialProcess.Library.csproj index bb58a792..f996d012 100644 --- a/src/processes/CredentialProcess.Library/CredentialProcess.Library.csproj +++ b/src/processes/CredentialProcess.Library/CredentialProcess.Library.csproj @@ -22,7 +22,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.CredentialProcess.Library Org.Eclipse.TractusX.SsiCredentialIssuer.CredentialProcess.Library - net7.0 + net8.0 enable enable diff --git a/src/processes/CredentialProcess.Library/Expiry/CredentialExpiryProcessHandler.cs b/src/processes/CredentialProcess.Library/Expiry/CredentialExpiryProcessHandler.cs index c1fc6ed2..1660e571 100644 --- a/src/processes/CredentialProcess.Library/Expiry/CredentialExpiryProcessHandler.cs +++ b/src/processes/CredentialProcess.Library/Expiry/CredentialExpiryProcessHandler.cs @@ -48,7 +48,7 @@ public CredentialExpiryProcessHandler(IIssuerRepositories repositories, IWalletS { var credentialRepository = _repositories.GetInstance(); var data = await credentialRepository.GetRevocationDataById(credentialId, string.Empty) - .ConfigureAwait(false); + .ConfigureAwait(ConfigureAwaitOptions.None); if (!data.Exists) { throw new NotFoundException($"Credential {credentialId} does not exist"); @@ -60,7 +60,7 @@ public CredentialExpiryProcessHandler(IIssuerRepositories repositories, IWalletS } // call walletService - await _walletService.RevokeCredentialForIssuer(data.ExternalCredentialId.Value, cancellationToken).ConfigureAwait(false); + await _walletService.RevokeCredentialForIssuer(data.ExternalCredentialId.Value, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); _repositories.GetInstance().AttachAndModifyDocuments( data.Documents.Select(d => new ValueTuple?, Action>( @@ -82,7 +82,7 @@ public CredentialExpiryProcessHandler(IIssuerRepositories repositories, IWalletS public async Task<(IEnumerable? nextStepTypeIds, ProcessStepStatusId stepStatusId, bool modified, string? processMessage)> TriggerNotification(Guid credentialId, CancellationToken cancellationToken) { - var (typeId, requesterId) = await _repositories.GetInstance().GetCredentialNotificationData(credentialId).ConfigureAwait(false); + var (typeId, requesterId) = await _repositories.GetInstance().GetCredentialNotificationData(credentialId).ConfigureAwait(ConfigureAwaitOptions.None); if (Guid.TryParse(requesterId, out var companyUserId)) { var content = JsonSerializer.Serialize(new { Type = typeId, CredentialId = credentialId }, Options); @@ -98,7 +98,7 @@ public CredentialExpiryProcessHandler(IIssuerRepositories repositories, IWalletS public async Task<(IEnumerable? nextStepTypeIds, ProcessStepStatusId stepStatusId, bool modified, string? processMessage)> TriggerMail(Guid credentialId, CancellationToken cancellationToken) { - var (typeId, requesterId) = await _repositories.GetInstance().GetCredentialNotificationData(credentialId).ConfigureAwait(false); + var (typeId, requesterId) = await _repositories.GetInstance().GetCredentialNotificationData(credentialId).ConfigureAwait(ConfigureAwaitOptions.None); var typeValue = typeId.GetEnumValue() ?? throw new UnexpectedConditionException($"VerifiedCredentialType {typeId} does not exists"); if (Guid.TryParse(requesterId, out var companyUserId)) diff --git a/src/processes/CredentialProcess.Worker/Creation/CredentialCreationProcessTypeExecutor.cs b/src/processes/CredentialProcess.Worker/Creation/CredentialCreationProcessTypeExecutor.cs index 745ef098..69357b87 100644 --- a/src/processes/CredentialProcess.Worker/Creation/CredentialCreationProcessTypeExecutor.cs +++ b/src/processes/CredentialProcess.Worker/Creation/CredentialCreationProcessTypeExecutor.cs @@ -56,7 +56,7 @@ public CredentialCreationProcessTypeExecutor( public async ValueTask InitializeProcess(Guid processId, IEnumerable processStepTypeIds) { - var (exists, credentialId) = await _issuerRepositories.GetInstance().GetDataForProcessId(processId).ConfigureAwait(false); + var (exists, credentialId) = await _issuerRepositories.GetInstance().GetDataForProcessId(processId).ConfigureAwait(ConfigureAwaitOptions.None); if (!exists) { throw new NotFoundException($"process {processId} does not exist or is not associated with an credential"); @@ -83,15 +83,15 @@ public CredentialCreationProcessTypeExecutor( (nextStepTypeIds, stepStatusId, modified, processMessage) = processStepTypeId switch { ProcessStepTypeId.CREATE_CREDENTIAL => await _credentialCreationProcessHandler.CreateCredential(_credentialId, cancellationToken) - .ConfigureAwait(false), + .ConfigureAwait(ConfigureAwaitOptions.None), ProcessStepTypeId.SIGN_CREDENTIAL => await _credentialCreationProcessHandler.SignCredential(_credentialId, cancellationToken) - .ConfigureAwait(false), + .ConfigureAwait(ConfigureAwaitOptions.None), ProcessStepTypeId.SAVE_CREDENTIAL_DOCUMENT => await _credentialCreationProcessHandler.SaveCredentialDocument(_credentialId, cancellationToken) - .ConfigureAwait(false), + .ConfigureAwait(ConfigureAwaitOptions.None), ProcessStepTypeId.CREATE_CREDENTIAL_FOR_HOLDER => await _credentialCreationProcessHandler.CreateCredentialForHolder(_credentialId, cancellationToken) - .ConfigureAwait(false), + .ConfigureAwait(ConfigureAwaitOptions.None), ProcessStepTypeId.TRIGGER_CALLBACK => await _credentialCreationProcessHandler.TriggerCallback(_credentialId, cancellationToken) - .ConfigureAwait(false), + .ConfigureAwait(ConfigureAwaitOptions.None), _ => (null, ProcessStepStatusId.TODO, false, null) }; } diff --git a/src/processes/CredentialProcess.Worker/CredentialProcess.Worker.csproj b/src/processes/CredentialProcess.Worker/CredentialProcess.Worker.csproj index a45ba693..ffbd40a1 100644 --- a/src/processes/CredentialProcess.Worker/CredentialProcess.Worker.csproj +++ b/src/processes/CredentialProcess.Worker/CredentialProcess.Worker.csproj @@ -22,7 +22,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.CredentialProcess.Worker Org.Eclipse.TractusX.SsiCredentialIssuer.CredentialProcess.Worker - net7.0 + net8.0 enable enable diff --git a/src/processes/CredentialProcess.Worker/Expiry/CredentialExpiryProcessTypeExecutor.cs b/src/processes/CredentialProcess.Worker/Expiry/CredentialExpiryProcessTypeExecutor.cs index d73586cc..e8b010c8 100644 --- a/src/processes/CredentialProcess.Worker/Expiry/CredentialExpiryProcessTypeExecutor.cs +++ b/src/processes/CredentialProcess.Worker/Expiry/CredentialExpiryProcessTypeExecutor.cs @@ -54,7 +54,7 @@ public CredentialExpiryProcessTypeExecutor( public async ValueTask InitializeProcess(Guid processId, IEnumerable processStepTypeIds) { - var (exists, credentialId) = await _issuerRepositories.GetInstance().GetDataForProcessId(processId).ConfigureAwait(false); + var (exists, credentialId) = await _issuerRepositories.GetInstance().GetDataForProcessId(processId).ConfigureAwait(ConfigureAwaitOptions.None); if (!exists) { throw new NotFoundException($"process {processId} does not exist or is not associated with an credential"); @@ -81,11 +81,11 @@ public CredentialExpiryProcessTypeExecutor( (nextStepTypeIds, stepStatusId, modified, processMessage) = processStepTypeId switch { ProcessStepTypeId.REVOKE_CREDENTIAL => await _credentialExpiryProcessHandler.RevokeCredential(_credentialId, cancellationToken) - .ConfigureAwait(false), + .ConfigureAwait(ConfigureAwaitOptions.None), ProcessStepTypeId.TRIGGER_NOTIFICATION => await _credentialExpiryProcessHandler.TriggerNotification(_credentialId, cancellationToken) - .ConfigureAwait(false), + .ConfigureAwait(ConfigureAwaitOptions.None), ProcessStepTypeId.TRIGGER_MAIL => await _credentialExpiryProcessHandler.TriggerMail(_credentialId, cancellationToken) - .ConfigureAwait(false), + .ConfigureAwait(ConfigureAwaitOptions.None), _ => (null, ProcessStepStatusId.TODO, false, null) }; } diff --git a/src/processes/Processes.Library/Processes.Library.csproj b/src/processes/Processes.Library/Processes.Library.csproj index bbb4fd76..edcf898d 100644 --- a/src/processes/Processes.Library/Processes.Library.csproj +++ b/src/processes/Processes.Library/Processes.Library.csproj @@ -22,7 +22,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Processes.Library Org.Eclipse.TractusX.SsiCredentialIssuer.Processes.Library - net7.0 + net8.0 enable enable 76a1cf69-39e1-43a7-b6a7-fef83be5359f diff --git a/src/processes/Processes.Worker.Library/ProcessExecutionService.cs b/src/processes/Processes.Worker.Library/ProcessExecutionService.cs index a5edd1f0..180790cf 100644 --- a/src/processes/Processes.Worker.Library/ProcessExecutionService.cs +++ b/src/processes/Processes.Worker.Library/ProcessExecutionService.cs @@ -90,7 +90,7 @@ public async Task ExecuteAsync(CancellationToken stoppingToken) { if (hasChanged) { - await executorRepositories.SaveAsync().ConfigureAwait(false); + await executorRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None); } executorRepositories.Clear(); @@ -98,7 +98,7 @@ public async Task ExecuteAsync(CancellationToken stoppingToken) if (process.ReleaseLock()) { - await executorRepositories.SaveAsync().ConfigureAwait(false); + await executorRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None); executorRepositories.Clear(); } diff --git a/src/processes/Processes.Worker.Library/Processes.Worker.Library.csproj b/src/processes/Processes.Worker.Library/Processes.Worker.Library.csproj index be16ad8b..6721951e 100644 --- a/src/processes/Processes.Worker.Library/Processes.Worker.Library.csproj +++ b/src/processes/Processes.Worker.Library/Processes.Worker.Library.csproj @@ -22,20 +22,20 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Processes.Worker.Library Org.Eclipse.TractusX.SsiCredentialIssuer.Processes.Worker.Library - net7.0 + net8.0 enable enable - - - - - - - - + + + + + + + + diff --git a/src/processes/Processes.Worker/Processes.Worker.csproj b/src/processes/Processes.Worker/Processes.Worker.csproj index f61969f3..64cc0e51 100644 --- a/src/processes/Processes.Worker/Processes.Worker.csproj +++ b/src/processes/Processes.Worker/Processes.Worker.csproj @@ -22,7 +22,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Processes.Worker Org.Eclipse.TractusX.SsiCredentialIssuer.Processes.Worker - net7.0 + net8.0 enable enable Exe @@ -41,9 +41,9 @@ - - - + + + diff --git a/src/processes/Processes.Worker/Program.cs b/src/processes/Processes.Worker/Program.cs index 5b8cb16f..3133a8de 100644 --- a/src/processes/Processes.Worker/Program.cs +++ b/src/processes/Processes.Worker/Program.cs @@ -61,7 +61,7 @@ Log.Information("Start processing"); var workerInstance = host.Services.GetRequiredService(); - await workerInstance.ExecuteAsync(tokenSource.Token).ConfigureAwait(false); + await workerInstance.ExecuteAsync(tokenSource.Token).ConfigureAwait(ConfigureAwaitOptions.None); Log.Information("Execution finished shutting down"); } catch (Exception ex) when (!ex.GetType().Name.Equals("StopTheHostException", StringComparison.Ordinal)) diff --git a/tests/Tests.Shared/Extensions/HttpExtensions.cs b/tests/Tests.Shared/Extensions/HttpExtensions.cs index 56a77d38..86c42035 100644 --- a/tests/Tests.Shared/Extensions/HttpExtensions.cs +++ b/tests/Tests.Shared/Extensions/HttpExtensions.cs @@ -27,12 +27,12 @@ public static class HttpExtensions { public static async Task GetResultFromContent(this HttpResponseMessage response) { - using var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + using var responseStream = await response.Content.ReadAsStreamAsync(); var options = new JsonSerializerOptions { Converters = { new JsonStringEnumConverter(allowIntegerValues: false) } }; - return await JsonSerializer.DeserializeAsync(responseStream, options).ConfigureAwait(false) ?? throw new InvalidOperationException(); + return await JsonSerializer.DeserializeAsync(responseStream, options) ?? throw new InvalidOperationException(); } public static HttpContent ToJsonContent(this object data, JsonSerializerOptions options, string contentType) diff --git a/tests/Tests.Shared/Tests.Shared.csproj b/tests/Tests.Shared/Tests.Shared.csproj index 33d05345..5c6aa99a 100644 --- a/tests/Tests.Shared/Tests.Shared.csproj +++ b/tests/Tests.Shared/Tests.Shared.csproj @@ -21,7 +21,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Tests.Shared Org.Eclipse.TractusX.SsiCredentialIssuer.Tests.Shared - net7.0 + net8.0 enable enable diff --git a/tests/credentials/SsiCredentialIssuer.Expiry.App.Tests/ExpiryCheckServiceTests.cs b/tests/credentials/SsiCredentialIssuer.Expiry.App.Tests/ExpiryCheckServiceTests.cs index ef896cea..ad374f2d 100644 --- a/tests/credentials/SsiCredentialIssuer.Expiry.App.Tests/ExpiryCheckServiceTests.cs +++ b/tests/credentials/SsiCredentialIssuer.Expiry.App.Tests/ExpiryCheckServiceTests.cs @@ -103,7 +103,7 @@ public async Task ExecuteAsync_WithInactiveAndEligibleForDeletion_RemovesEntry() .Returns(data.ToAsyncEnumerable()); // Act - await _sut.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); + await _sut.ExecuteAsync(CancellationToken.None); // Assert A.CallTo(() => _companySsiDetailsRepository.RemoveSsiDetail(credentialId)).MustHaveHappenedOnceExactly(); @@ -134,7 +134,7 @@ public async Task ExecuteAsync_WithPendingAndExpiryBeforeNow_DeclinesRequest() .Returns(data.ToAsyncEnumerable()); // Act - await _sut.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); + await _sut.ExecuteAsync(CancellationToken.None); // Assert A.CallTo(() => _companySsiDetailsRepository.RemoveSsiDetail(ssiDetail.Id)).MustNotHaveHappened(); @@ -180,7 +180,7 @@ public async Task ExecuteAsync_WithActiveCloseToExpiry_NotifiesCreator(int days, }); // Act - await _sut.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); + await _sut.ExecuteAsync(CancellationToken.None); // Assert A.CallTo(() => _companySsiDetailsRepository.RemoveSsiDetail(ssiDetail.Id)).MustNotHaveHappened(); diff --git a/tests/credentials/SsiCredentialIssuer.Expiry.App.Tests/SsiCredentialIssuer.Expiry.App.Tests.csproj b/tests/credentials/SsiCredentialIssuer.Expiry.App.Tests/SsiCredentialIssuer.Expiry.App.Tests.csproj index b8f099c2..f57a9160 100644 --- a/tests/credentials/SsiCredentialIssuer.Expiry.App.Tests/SsiCredentialIssuer.Expiry.App.Tests.csproj +++ b/tests/credentials/SsiCredentialIssuer.Expiry.App.Tests/SsiCredentialIssuer.Expiry.App.Tests.csproj @@ -22,19 +22,18 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Expiry.App.Tests Org.Eclipse.TractusX.SsiCredentialIssuer.Expiry.App.Tests - net7.0 + net8.0 enable enable false - - + + - @@ -42,10 +41,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/tests/database/SsiCredentialIssuer.DbAccess.Tests/CompanySsiDetailsRepositoryTests.cs b/tests/database/SsiCredentialIssuer.DbAccess.Tests/CompanySsiDetailsRepositoryTests.cs index 156cb5df..721afdf8 100644 --- a/tests/database/SsiCredentialIssuer.DbAccess.Tests/CompanySsiDetailsRepositoryTests.cs +++ b/tests/database/SsiCredentialIssuer.DbAccess.Tests/CompanySsiDetailsRepositoryTests.cs @@ -56,7 +56,7 @@ public async Task GetDetailsForCompany_WithValidData_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetUseCaseParticipationForCompany(ValidBpnl, DateTimeOffset.MinValue).ToListAsync().ConfigureAwait(false); + var result = await sut.GetUseCaseParticipationForCompany(ValidBpnl, DateTimeOffset.MinValue).ToListAsync(); // Assert result.Should().HaveCount(8); @@ -83,7 +83,7 @@ public async Task GetDetailsForCompany_WithExpiryFilter_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetUseCaseParticipationForCompany(ValidBpnl, dt).ToListAsync().ConfigureAwait(false); + var result = await sut.GetUseCaseParticipationForCompany(ValidBpnl, dt).ToListAsync(); // Assert result.Should().HaveCount(8); @@ -113,7 +113,7 @@ public async Task GetAllCredentialDetails_WithValidData_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetAllCredentialDetails(null, null).ToListAsync().ConfigureAwait(false); + var result = await sut.GetAllCredentialDetails(null, null).ToListAsync(); // Assert result.Should().NotBeNull(); @@ -138,7 +138,7 @@ public async Task GetAllCredentialDetails_WithWithStatusId_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetAllCredentialDetails(CompanySsiDetailStatusId.PENDING, null).ToListAsync().ConfigureAwait(false); + var result = await sut.GetAllCredentialDetails(CompanySsiDetailStatusId.PENDING, null).ToListAsync(); // Assert result.Should().NotBeNull().And.HaveCount(4); @@ -159,7 +159,7 @@ public async Task GetAllCredentialDetails_WithWithCredentialType_ReturnsExpected var sut = await CreateSut(); // Act - var result = await sut.GetAllCredentialDetails(null, VerifiedCredentialTypeId.PCF_FRAMEWORK).ToListAsync().ConfigureAwait(false); + var result = await sut.GetAllCredentialDetails(null, VerifiedCredentialTypeId.PCF_FRAMEWORK).ToListAsync(); // Assert result.Should().NotBeNull().And.ContainSingle().Which.Bpnl.Should().Be(ValidBpnl); @@ -177,7 +177,7 @@ public async Task GetSsiCertificates_WithValidData_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetSsiCertificates(ValidBpnl, new DateTimeOffset(2023, 01, 01, 01, 01, 01, TimeSpan.Zero)).ToListAsync().ConfigureAwait(false); + var result = await sut.GetSsiCertificates(ValidBpnl, new DateTimeOffset(2023, 01, 01, 01, 01, 01, TimeSpan.Zero)).ToListAsync(); // Assert result.Should().HaveCount(2) @@ -200,7 +200,7 @@ public async Task GetOwnCredentialDetails_WithValidData_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetOwnCredentialDetails(ValidBpnl).ToListAsync().ConfigureAwait(false); + var result = await sut.GetOwnCredentialDetails(ValidBpnl).ToListAsync(); // Assert result.Should().HaveCount(6) @@ -221,7 +221,7 @@ public async Task GetOwnCredentialDetails_WithBpnWithoutCredential_ReturnsExpect var sut = await CreateSut(); // Act - var result = await sut.GetOwnCredentialDetails("BPNL000000INVALID").ToListAsync().ConfigureAwait(false); + var result = await sut.GetOwnCredentialDetails("BPNL000000INVALID").ToListAsync(); // Assert result.Should().BeEmpty(); @@ -258,7 +258,7 @@ public async Task CheckCredentialDetailsExistsForCompany_WithExistingData_Return var sut = await CreateSut(); // Act - var result = await sut.CheckSsiDetailsExistsForCompany(ValidBpnl, VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK, VerifiedCredentialTypeKindId.FRAMEWORK, new Guid("1268a76a-ca19-4dd8-b932-01f24071d560")).ConfigureAwait(false); + var result = await sut.CheckSsiDetailsExistsForCompany(ValidBpnl, VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK, VerifiedCredentialTypeKindId.FRAMEWORK, new Guid("1268a76a-ca19-4dd8-b932-01f24071d560")); // Assert result.Should().BeTrue(); @@ -271,7 +271,7 @@ public async Task CheckCredentialDetailsExistsForCompany_WithNotExistingData_Ret var sut = await CreateSut(); // Act - var result = await sut.CheckSsiDetailsExistsForCompany("BPNL000000001TEST", VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK, VerifiedCredentialTypeKindId.FRAMEWORK, new Guid("1268a76a-ca19-4dd8-b932-01f24071d560")).ConfigureAwait(false); + var result = await sut.CheckSsiDetailsExistsForCompany("BPNL000000001TEST", VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK, VerifiedCredentialTypeKindId.FRAMEWORK, new Guid("1268a76a-ca19-4dd8-b932-01f24071d560")); // Assert result.Should().BeFalse(); @@ -284,7 +284,7 @@ public async Task CheckCredentialDetailsExistsForCompany_WithWrongTypeKindId_Ret var sut = await CreateSut(); // Act - var result = await sut.CheckSsiDetailsExistsForCompany("BPNL000000001TEST", VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK, VerifiedCredentialTypeKindId.MEMBERSHIP, new Guid("1268a76a-ca19-4dd8-b932-01f24071d560")).ConfigureAwait(false); + var result = await sut.CheckSsiDetailsExistsForCompany("BPNL000000001TEST", VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK, VerifiedCredentialTypeKindId.MEMBERSHIP, new Guid("1268a76a-ca19-4dd8-b932-01f24071d560")); // Assert result.Should().BeFalse(); @@ -297,7 +297,7 @@ public async Task CheckCredentialDetailsExistsForCompany_WithInactive_ReturnsFal var sut = await CreateSut(); // Act - var result = await sut.CheckSsiDetailsExistsForCompany(ValidBpnl, VerifiedCredentialTypeId.BEHAVIOR_TWIN_FRAMEWORK, VerifiedCredentialTypeKindId.FRAMEWORK, new Guid("1268a76a-ca19-4dd8-b932-01f24071d562")).ConfigureAwait(false); + var result = await sut.CheckSsiDetailsExistsForCompany(ValidBpnl, VerifiedCredentialTypeId.BEHAVIOR_TWIN_FRAMEWORK, VerifiedCredentialTypeKindId.FRAMEWORK, new Guid("1268a76a-ca19-4dd8-b932-01f24071d562")); // Assert result.Should().BeFalse(); @@ -319,7 +319,7 @@ public async Task CheckUseCaseCredentialAndExternalTypeDetails_WithTypeId_Return var sut = await CreateSut(); // Act - var result = await sut.CheckCredentialTypeIdExistsForExternalTypeDetailVersionId(detailId, typeId).ConfigureAwait(false); + var result = await sut.CheckCredentialTypeIdExistsForExternalTypeDetailVersionId(detailId, typeId); // Assert result.Expiry.Should().Be(expiry); @@ -340,7 +340,7 @@ public async Task CheckSsiCertificateType_WithTypeId_ReturnsTrue(VerifiedCredent var sut = await CreateSut(); // Act - var result = await sut.CheckSsiCertificateType(typeId).ConfigureAwait(false); + var result = await sut.CheckSsiCertificateType(typeId); // Assert result.Exists.Should().Be(expectedResult); @@ -357,7 +357,7 @@ public async Task GetSsiApprovalData_WithValidData_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetSsiApprovalData(new("9f5b9934-4014-4099-91e9-7b1aee696b03")).ConfigureAwait(false); + var result = await sut.GetSsiApprovalData(new("9f5b9934-4014-4099-91e9-7b1aee696b03")); // Assert result.exists.Should().BeTrue(); @@ -373,7 +373,7 @@ public async Task GetSsiApprovalData_WithNotExisting_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetSsiApprovalData(Guid.NewGuid()).ConfigureAwait(false); + var result = await sut.GetSsiApprovalData(Guid.NewGuid()); // Assert result.exists.Should().BeFalse(); @@ -390,7 +390,7 @@ public async Task GetSsiRejectionData_WithValidData_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetSsiRejectionData(new("9f5b9934-4014-4099-91e9-7b1aee696b03")).ConfigureAwait(false); + var result = await sut.GetSsiRejectionData(new("9f5b9934-4014-4099-91e9-7b1aee696b03")); // Assert result.Exists.Should().BeTrue(); @@ -405,7 +405,7 @@ public async Task GetSsiRejectionData_WithNotExisting_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetSsiRejectionData(Guid.NewGuid()).ConfigureAwait(false); + var result = await sut.GetSsiRejectionData(Guid.NewGuid()); // Assert result.Should().Be(default); @@ -471,7 +471,7 @@ public async Task GetCertificateTypes_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetCertificateTypes(ValidBpnl).ToListAsync().ConfigureAwait(false); + var result = await sut.GetCertificateTypes(ValidBpnl).ToListAsync(); // Assert result.Should().ContainSingle().Which.Should().Be(VerifiedCredentialTypeId.BUSINESS_PARTNER_NUMBER); @@ -484,7 +484,7 @@ public async Task GetCertificateTypes_WithoutCertificate_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetCertificateTypes("BPNL0000001TEST").ToListAsync().ConfigureAwait(false); + var result = await sut.GetCertificateTypes("BPNL0000001TEST").ToListAsync(); // Assert result.Should().HaveCount(2).And.Satisfy( @@ -506,7 +506,7 @@ public async Task GetExpiryData_ReturnsExpected() var sut = await CreateSut(); // Act - var result = await sut.GetExpiryData(now, inactiveVcsToDelete, expiredVcsToDelete).ToListAsync().ConfigureAwait(false); + var result = await sut.GetExpiryData(now, inactiveVcsToDelete, expiredVcsToDelete).ToListAsync(); // Assert result.Should().HaveCount(6); @@ -616,13 +616,13 @@ public async Task AttachAndModifyProcessData_WithNoChanges_ReturnsExpected() private async Task CreateSut() { - var context = await _dbTestDbFixture.GetDbContext().ConfigureAwait(false); + var context = await _dbTestDbFixture.GetDbContext(); return new CompanySsiDetailsRepository(context); } private async Task<(CompanySsiDetailsRepository sut, IssuerDbContext context)> CreateSutWithContext() { - var context = await _dbTestDbFixture.GetDbContext().ConfigureAwait(false); + var context = await _dbTestDbFixture.GetDbContext(); return (new CompanySsiDetailsRepository(context), context); } diff --git a/tests/database/SsiCredentialIssuer.DbAccess.Tests/CredentialRepositoryTests.cs b/tests/database/SsiCredentialIssuer.DbAccess.Tests/CredentialRepositoryTests.cs index a306588a..6d80e5a4 100644 --- a/tests/database/SsiCredentialIssuer.DbAccess.Tests/CredentialRepositoryTests.cs +++ b/tests/database/SsiCredentialIssuer.DbAccess.Tests/CredentialRepositoryTests.cs @@ -54,7 +54,7 @@ public CredentialRepositoryTests(TestDbFixture testDbFixture) public async Task GetDataForProcessId_ReturnsExpectedDocument() { // Arrange - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act var result = await sut.GetDataForProcessId(new Guid("dd371565-9489-4907-a2e4-b8cbfe7a8cd2")); @@ -72,7 +72,7 @@ public async Task GetDataForProcessId_ReturnsExpectedDocument() public async Task GetCredentialData_ReturnsExpectedDocument() { // Arrange - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act var result = await sut.GetCredentialData(new Guid("9f5b9934-4014-4099-91e9-7b1aee696b03")); @@ -91,7 +91,7 @@ public async Task GetCredentialData_ReturnsExpectedDocument() public async Task GetWalletCredentialId_ReturnsExpectedDocument() { // Arrange - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act var result = await sut.GetWalletCredentialId(new Guid("9f5b9934-4014-4099-91e9-7b1aee696b03")); @@ -108,7 +108,7 @@ public async Task GetWalletCredentialId_ReturnsExpectedDocument() public async Task GetCredentialStorageInformationById_ReturnsExpectedDocument() { // Arrange - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act var result = await sut.GetCredentialStorageInformationById(new Guid("9f5b9934-4014-4099-91e9-7b1aee696b03")); @@ -126,7 +126,7 @@ public async Task GetCredentialStorageInformationById_ReturnsExpectedDocument() public async Task GetExternalCredentialAndKindId_ReturnsExpectedDocument() { // Arrange - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act var result = await sut.GetExternalCredentialAndKindId(new Guid("9f5b9934-4014-4099-91e9-7b1aee696b03")); @@ -144,7 +144,7 @@ public async Task GetExternalCredentialAndKindId_ReturnsExpectedDocument() public async Task AttachAndModifyCredential_ReturnsExpectedResult() { // Arrange - var (sut, context) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, context) = await CreateSutWithContext(); // Act sut.AttachAndModifyCredential(Guid.NewGuid(), x => x.CompanySsiDetailStatusId = CompanySsiDetailStatusId.ACTIVE, x => x.CompanySsiDetailStatusId = CompanySsiDetailStatusId.PENDING); @@ -165,14 +165,14 @@ public async Task AttachAndModifyCredential_ReturnsExpectedResult() private async Task CreateSut() { - var context = await _dbTestDbFixture.GetDbContext().ConfigureAwait(false); + var context = await _dbTestDbFixture.GetDbContext(); var sut = new CredentialRepository(context); return sut; } private async Task<(CredentialRepository Sut, IssuerDbContext Context)> CreateSutWithContext() { - var context = await _dbTestDbFixture.GetDbContext().ConfigureAwait(false); + var context = await _dbTestDbFixture.GetDbContext(); var sut = new CredentialRepository(context); return (sut, context); } diff --git a/tests/database/SsiCredentialIssuer.DbAccess.Tests/DocumentRepositoryTests.cs b/tests/database/SsiCredentialIssuer.DbAccess.Tests/DocumentRepositoryTests.cs index a33be766..06a43755 100644 --- a/tests/database/SsiCredentialIssuer.DbAccess.Tests/DocumentRepositoryTests.cs +++ b/tests/database/SsiCredentialIssuer.DbAccess.Tests/DocumentRepositoryTests.cs @@ -55,7 +55,7 @@ public DocumentRepositoryTests(TestDbFixture testDbFixture) public async Task CreateDocument_ReturnsExpectedDocument() { // Arrange - var (sut, context) = await CreateSut().ConfigureAwait(false); + var (sut, context) = await CreateSut(); var test = "This is just test content"; var content = Encoding.UTF8.GetBytes(test); @@ -85,7 +85,7 @@ public async Task CreateDocument_ReturnsExpectedDocument() public async Task AssignDocumentToCompanySsiDetails_ReturnsExpectedDocument() { // Arrange - var (sut, context) = await CreateSut().ConfigureAwait(false); + var (sut, context) = await CreateSut(); var companySsiDetailId = Guid.NewGuid(); var documentId = Guid.NewGuid(); @@ -110,7 +110,7 @@ public async Task AssignDocumentToCompanySsiDetails_ReturnsExpectedDocument() public async Task AttachAndModifyDocuments_ReturnsExpectedResult() { // Arrange - var (sut, context) = await CreateSut().ConfigureAwait(false); + var (sut, context) = await CreateSut(); var documentData = new (Guid DocumentId, Action?, Action)[] { (Guid.NewGuid(), null, document => document.DocumentStatusId = DocumentStatusId.INACTIVE), @@ -138,7 +138,7 @@ public async Task AttachAndModifyDocuments_ReturnsExpectedResult() private async Task<(DocumentRepository, IssuerDbContext)> CreateSut() { - var context = await _dbTestDbFixture.GetDbContext().ConfigureAwait(false); + var context = await _dbTestDbFixture.GetDbContext(); var sut = new DocumentRepository(context); return (sut, context); } diff --git a/tests/database/SsiCredentialIssuer.DbAccess.Tests/IssuerDbContextTests.cs b/tests/database/SsiCredentialIssuer.DbAccess.Tests/IssuerDbContextTests.cs index 502354e9..0acb8021 100644 --- a/tests/database/SsiCredentialIssuer.DbAccess.Tests/IssuerDbContextTests.cs +++ b/tests/database/SsiCredentialIssuer.DbAccess.Tests/IssuerDbContextTests.cs @@ -63,12 +63,12 @@ public async Task SaveCreatedAuditableEntity_SetsLastEditorId() var id = Guid.NewGuid(); var ca = new CompanySsiDetail(id, "BPNL00000001TEST", VerifiedCredentialTypeId.BUSINESS_PARTNER_NUMBER, CompanySsiDetailStatusId.ACTIVE, "BPNL0001ISSUER", "ac1cf001-7fbc-1f2f-817f-bce058020001", before); - var sut = await CreateContext().ConfigureAwait(false); - using var trans = await sut.Database.BeginTransactionAsync().ConfigureAwait(false); + var sut = await CreateContext(); + using var trans = await sut.Database.BeginTransactionAsync(); // Act sut.Add(ca); - await sut.SaveChangesAsync().ConfigureAwait(false); + await sut.SaveChangesAsync(); // Assert ca.LastEditorId.Should().NotBeNull().And.Be("ac1cf001-7fbc-1f2f-817f-bce058020001"); @@ -76,7 +76,7 @@ public async Task SaveCreatedAuditableEntity_SetsLastEditorId() var auditEntries = await sut.AuditCompanySsiDetail20240419.Where(x => x.Id == id).ToListAsync(); auditEntries.Should().ContainSingle().Which.Should().Match( x => x.CompanySsiDetailStatusId == CompanySsiDetailStatusId.ACTIVE && (x.DateCreated - before) < TimeSpan.FromSeconds(1) && x.AuditV2OperationId == AuditOperationId.INSERT && (x.AuditV2DateLastChanged - now) < TimeSpan.FromSeconds(1) && x.LastEditorId == "ac1cf001-7fbc-1f2f-817f-bce058020001"); - await trans.RollbackAsync().ConfigureAwait(false); + await trans.RollbackAsync(); } [Fact] @@ -91,14 +91,14 @@ public async Task SaveDeletedAuditableEntity_SetsLastEditorId() var id = Guid.NewGuid(); var ca = new CompanySsiDetail(id, "BPNL00000001TEST", VerifiedCredentialTypeId.BUSINESS_PARTNER_NUMBER, CompanySsiDetailStatusId.ACTIVE, "BPNL0001ISSUER", "ac1cf001-7fbc-1f2f-817f-bce058020001", before); - var sut = await CreateContext().ConfigureAwait(false); - using var trans = await sut.Database.BeginTransactionAsync().ConfigureAwait(false); + var sut = await CreateContext(); + using var trans = await sut.Database.BeginTransactionAsync(); // Act sut.Add(ca); - await sut.SaveChangesAsync().ConfigureAwait(false); + await sut.SaveChangesAsync(); sut.Remove(ca); - await sut.SaveChangesAsync().ConfigureAwait(false); + await sut.SaveChangesAsync(); // Assert ca.LastEditorId.Should().NotBeNull().And.Be("ac1cf001-7fbc-1f2f-817f-bce058020001"); @@ -107,11 +107,11 @@ public async Task SaveDeletedAuditableEntity_SetsLastEditorId() auditEntries.Should().HaveCount(2).And.Satisfy( x => x.CompanySsiDetailStatusId == CompanySsiDetailStatusId.ACTIVE && (x.DateCreated - before) < TimeSpan.FromSeconds(1) && x.AuditV2OperationId == AuditOperationId.INSERT && x.LastEditorId == "ac1cf001-7fbc-1f2f-817f-bce058020001", x => x.CompanySsiDetailStatusId == CompanySsiDetailStatusId.ACTIVE && (x.DateCreated - before) < TimeSpan.FromSeconds(1) && x.AuditV2OperationId == AuditOperationId.DELETE && (x.AuditV2DateLastChanged - later) < TimeSpan.FromSeconds(1) && x.LastEditorId == "ac1cf001-7fbc-1f2f-817f-bce058020001"); - await trans.RollbackAsync().ConfigureAwait(false); + await trans.RollbackAsync(); } #endregion private async Task CreateContext() => - await _dbTestDbFixture.GetDbContext(_dateTimeProvider).ConfigureAwait(false); + await _dbTestDbFixture.GetDbContext(_dateTimeProvider); } diff --git a/tests/database/SsiCredentialIssuer.DbAccess.Tests/IssuerRepositoriesTests.cs b/tests/database/SsiCredentialIssuer.DbAccess.Tests/IssuerRepositoriesTests.cs index f836deaf..a2e3a7da 100644 --- a/tests/database/SsiCredentialIssuer.DbAccess.Tests/IssuerRepositoriesTests.cs +++ b/tests/database/SsiCredentialIssuer.DbAccess.Tests/IssuerRepositoriesTests.cs @@ -53,7 +53,7 @@ public IssuerRepositoriesTests(TestDbFixture testDbFixture) public async Task GetInstance_CompanySsiDetails_CreatesSuccessfully() { // Arrange - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act var result = sut.GetInstance(); @@ -66,7 +66,7 @@ public async Task GetInstance_CompanySsiDetails_CreatesSuccessfully() public async Task GetInstance_Credential_CreatesSuccessfully() { // Arrange - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act var result = sut.GetInstance(); @@ -79,7 +79,7 @@ public async Task GetInstance_Credential_CreatesSuccessfully() public async Task GetInstance_DocumentRepo_CreatesSuccessfully() { // Arrange - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act var result = sut.GetInstance(); @@ -92,7 +92,7 @@ public async Task GetInstance_DocumentRepo_CreatesSuccessfully() public async Task GetInstance_ProcessStep_CreatesSuccessfully() { // Arrange - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act var result = sut.GetInstance(); @@ -109,7 +109,7 @@ public async Task GetInstance_ProcessStep_CreatesSuccessfully() public async Task Clear_CreateSuccessfully() { // Arrange - var (sut, dbContext) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, dbContext) = await CreateSutWithContext(); var changeTracker = dbContext.ChangeTracker; dbContext.Processes.Add(new Process(Guid.NewGuid(), ProcessTypeId.CREATE_CREDENTIAL, Guid.NewGuid())); @@ -129,7 +129,7 @@ public async Task Clear_CreateSuccessfully() public async Task Attach_CreateSuccessfully() { // Arrange - var (sut, dbContext) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, dbContext) = await CreateSutWithContext(); var changeTracker = dbContext.ChangeTracker; var now = DateTimeOffset.Now; @@ -153,14 +153,14 @@ public async Task Attach_CreateSuccessfully() private async Task<(IssuerRepositories sut, IssuerDbContext dbContext)> CreateSutWithContext() { - var context = await _dbTestDbFixture.GetDbContext().ConfigureAwait(false); + var context = await _dbTestDbFixture.GetDbContext(); var sut = new IssuerRepositories(context); return (sut, context); } private async Task CreateSut() { - var context = await _dbTestDbFixture.GetDbContext().ConfigureAwait(false); + var context = await _dbTestDbFixture.GetDbContext(); var sut = new IssuerRepositories(context); return sut; } diff --git a/tests/database/SsiCredentialIssuer.DbAccess.Tests/ProcessStepRepositoryTests.cs b/tests/database/SsiCredentialIssuer.DbAccess.Tests/ProcessStepRepositoryTests.cs index e7c6d62c..f8bf2b26 100644 --- a/tests/database/SsiCredentialIssuer.DbAccess.Tests/ProcessStepRepositoryTests.cs +++ b/tests/database/SsiCredentialIssuer.DbAccess.Tests/ProcessStepRepositoryTests.cs @@ -53,7 +53,7 @@ public ProcessStepRepositoryTests(TestDbFixture testDbFixture) public async Task CreateProcess_CreatesSuccessfully() { // Arrange - var (sut, dbContext) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, dbContext) = await CreateSutWithContext(); var changeTracker = dbContext.ChangeTracker; // Act @@ -84,7 +84,7 @@ public async Task CreateProcessStepRange_CreateSuccessfully() // Arrange var processId = Guid.NewGuid(); var processStepTypeIds = _fixture.CreateMany(3).ToImmutableArray(); - var (sut, dbContext) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, dbContext) = await CreateSutWithContext(); var changeTracker = dbContext.ChangeTracker; // Act @@ -116,7 +116,7 @@ public async Task CreateProcessStep_CreateSuccessfully() { // Arrange var processId = Guid.NewGuid(); - var (sut, dbContext) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, dbContext) = await CreateSutWithContext(); var changeTracker = dbContext.ChangeTracker; // Act @@ -141,7 +141,7 @@ public async Task CreateProcessStep_CreateSuccessfully() public async Task AttachAndModifyProcessStep_WithExistingProcessStep_UpdatesStatus() { // Arrange - var (sut, dbContext) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, dbContext) = await CreateSutWithContext(); // Act sut.AttachAndModifyProcessStep(new Guid("48f35f84-8d98-4fbd-ba80-8cbce5eeadb5"), @@ -176,7 +176,7 @@ public async Task AttachAndModifyProcessSteps_UpdatesStatus() // Arrange var stepData = _fixture.CreateMany<(Guid ProcessStepId, ProcessStep InitialStep, ProcessStep ModifiedStep)>(5).ToImmutableArray(); - var (sut, dbContext) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, dbContext) = await CreateSutWithContext(); // Act sut.AttachAndModifyProcessSteps(stepData.Select(data => new ValueTuple?, Action>( @@ -214,7 +214,7 @@ public async Task AttachAndModifyProcessSteps_WithUnmodifiedData_SkipsUpdateStat // Arrange var stepData = _fixture.CreateMany<(Guid ProcessStepId, ProcessStep InitialStep)>(5).ToImmutableArray(); - var (sut, dbContext) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, dbContext) = await CreateSutWithContext(); // Act sut.AttachAndModifyProcessSteps(stepData.Select(data => new ValueTuple?, Action>( @@ -250,7 +250,7 @@ public async Task AttachAndModifyProcessSteps_WithUnmodifiedData_UpdatesLastChan // Arrange var stepData = _fixture.CreateMany<(Guid ProcessStepId, ProcessStep InitialStep)>(5).ToImmutableArray(); - var (sut, dbContext) = await CreateSutWithContext().ConfigureAwait(false); + var (sut, dbContext) = await CreateSutWithContext(); // Act sut.AttachAndModifyProcessSteps(stepData.Select(data => new ValueTuple?, Action>( @@ -293,10 +293,10 @@ public async Task GetActiveProcess_LockExpired_ReturnsExpected() ProcessStepTypeId.CREATE_CREDENTIAL_FOR_HOLDER, }; - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act - var result = await sut.GetActiveProcesses(processTypeIds, processStepTypeIds, DateTimeOffset.Parse("2023-03-02 00:00:00.000000 +00:00")).ToListAsync().ConfigureAwait(false); + var result = await sut.GetActiveProcesses(processTypeIds, processStepTypeIds, DateTimeOffset.Parse("2023-03-02 00:00:00.000000 +00:00")).ToListAsync(); result.Should().HaveCount(1) .And.Satisfy( x => x.Id == new Guid("dd371565-9489-4907-a2e4-b8cbfe7a8cd2") && x.ProcessTypeId == ProcessTypeId.CREATE_CREDENTIAL && x.LockExpiryDate == DateTimeOffset.Parse("2023-03-01 00:00:00.000000 +00:00") @@ -315,10 +315,10 @@ public async Task GetActiveProcess_Locked_ReturnsExpected() ProcessStepTypeId.CREATE_CREDENTIAL_FOR_HOLDER, }; - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act - var result = await sut.GetActiveProcesses(processTypeIds, processStepTypeIds, DateTimeOffset.Parse("2023-02-28 00:00:00.000000 +00:00")).ToListAsync().ConfigureAwait(false); + var result = await sut.GetActiveProcesses(processTypeIds, processStepTypeIds, DateTimeOffset.Parse("2023-02-28 00:00:00.000000 +00:00")).ToListAsync(); result.Should().BeEmpty(); } @@ -331,10 +331,10 @@ public async Task GetProcessStepData_ReturnsExpected() { // Arrange var processId = new Guid("dd371565-9489-4907-a2e4-b8cbfe7a8cd2"); - var sut = await CreateSut().ConfigureAwait(false); + var sut = await CreateSut(); // Act - var result = await sut.GetProcessStepData(processId).ToListAsync().ConfigureAwait(false); + var result = await sut.GetProcessStepData(processId).ToListAsync(); result.Should().HaveCount(1) .And.Satisfy( x => x.ProcessStepId == new Guid("cd231cb8-55de-4ae4-b93f-d440512341fb") && x.ProcessStepTypeId == ProcessStepTypeId.SAVE_CREDENTIAL_DOCUMENT @@ -345,14 +345,14 @@ public async Task GetProcessStepData_ReturnsExpected() private async Task<(ProcessStepRepository sut, IssuerDbContext dbContext)> CreateSutWithContext() { - var context = await _dbTestDbFixture.GetDbContext().ConfigureAwait(false); + var context = await _dbTestDbFixture.GetDbContext(); var sut = new ProcessStepRepository(context); return (sut, context); } private async Task CreateSut() { - var context = await _dbTestDbFixture.GetDbContext().ConfigureAwait(false); + var context = await _dbTestDbFixture.GetDbContext(); var sut = new ProcessStepRepository(context); return sut; } diff --git a/tests/database/SsiCredentialIssuer.DbAccess.Tests/Setup/TestDbFixture.cs b/tests/database/SsiCredentialIssuer.DbAccess.Tests/Setup/TestDbFixture.cs index 9095640a..cbd762c9 100644 --- a/tests/database/SsiCredentialIssuer.DbAccess.Tests/Setup/TestDbFixture.cs +++ b/tests/database/SsiCredentialIssuer.DbAccess.Tests/Setup/TestDbFixture.cs @@ -62,13 +62,13 @@ public async Task GetDbContext(IDateTimeProvider? dateTimeProvi .MigrationsHistoryTable("__efmigrations_history_issuer") ); var context = new IssuerDbContext(optionsBuilder.Options, new AuditHandlerV2(new FakeIdentityIdService(), dateTimeProvider ?? new UtcDateTimeProvider())); - await context.Database.EnsureCreatedAsync().ConfigureAwait(false); + await context.Database.EnsureCreatedAsync(); foreach (var seedAction in seedActions) { seedAction.Invoke(context); } - await context.SaveChangesAsync().ConfigureAwait(false); + await context.SaveChangesAsync(); return context; } @@ -78,7 +78,7 @@ public async Task GetDbContext(IDateTimeProvider? dateTimeProvi public async Task InitializeAsync() { await _container.StartAsync() - .ConfigureAwait(false); + ; var optionsBuilder = new DbContextOptionsBuilder(); @@ -109,6 +109,6 @@ await _container.StartAsync() public async Task DisposeAsync() { await _container.DisposeAsync() - .ConfigureAwait(false); + ; } } diff --git a/tests/database/SsiCredentialIssuer.DbAccess.Tests/SsiCredentialIssuer.DbAccess.Tests.csproj b/tests/database/SsiCredentialIssuer.DbAccess.Tests/SsiCredentialIssuer.DbAccess.Tests.csproj index 9a600cc4..d6fb2580 100644 --- a/tests/database/SsiCredentialIssuer.DbAccess.Tests/SsiCredentialIssuer.DbAccess.Tests.csproj +++ b/tests/database/SsiCredentialIssuer.DbAccess.Tests/SsiCredentialIssuer.DbAccess.Tests.csproj @@ -21,21 +21,20 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.DbAccess.Tests Org.Eclipse.TractusX.SsiCredentialIssuer.DbAccess.Tests - net7.0 + net8.0 enable enable false - - + + - - + @@ -43,10 +42,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/tests/externalservices/Callback.Service.Tests/Callback.Service.Tests.csproj b/tests/externalservices/Callback.Service.Tests/Callback.Service.Tests.csproj index 793659a7..d29387e0 100644 --- a/tests/externalservices/Callback.Service.Tests/Callback.Service.Tests.csproj +++ b/tests/externalservices/Callback.Service.Tests/Callback.Service.Tests.csproj @@ -21,7 +21,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Callback.Service.Tests Org.Eclipse.TractusX.SsiCredentialIssuer.Callback.Service.Tests - net7.0 + net8.0 enable enable false @@ -32,9 +32,8 @@ - - - + + @@ -46,10 +45,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/tests/externalservices/Callback.Service.Tests/CallbackServiceTests.cs b/tests/externalservices/Callback.Service.Tests/CallbackServiceTests.cs index a4f2f5de..2630a15e 100644 --- a/tests/externalservices/Callback.Service.Tests/CallbackServiceTests.cs +++ b/tests/externalservices/Callback.Service.Tests/CallbackServiceTests.cs @@ -78,7 +78,7 @@ public async Task TriggerCallback_WithValid_DoesNotThrowException() var sut = _fixture.Create(); // Act - await sut.TriggerCallback("/callback", data, CancellationToken.None).ConfigureAwait(false); + await sut.TriggerCallback("/callback", data, CancellationToken.None); // Assert request.Should().NotBeNull(); @@ -101,7 +101,7 @@ public async Task TriggerCallback_WithConflict_ThrowsServiceExceptionWithErrorCo httpClient.BaseAddress = new Uri("https://base.address.com"); A.CallTo(() => _tokenService.GetAuthorizedClient(_options.Value, A._)).Returns(httpClient); var sut = new CallbackService(_tokenService, _options); - async Task Act() => await sut.TriggerCallback("https://example.org/callback", _fixture.Create(), CancellationToken.None).ConfigureAwait(false); + async Task Act() => await sut.TriggerCallback("https://example.org/callback", _fixture.Create(), CancellationToken.None); // Act var ex = await Assert.ThrowsAsync(Act); diff --git a/tests/externalservices/Portal.Service.Tests/Portal.Service.Tests.csproj b/tests/externalservices/Portal.Service.Tests/Portal.Service.Tests.csproj index aea8d179..604a2a6c 100644 --- a/tests/externalservices/Portal.Service.Tests/Portal.Service.Tests.csproj +++ b/tests/externalservices/Portal.Service.Tests/Portal.Service.Tests.csproj @@ -21,7 +21,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Portal.Service.Tests Org.Eclipse.TractusX.SsiCredentialIssuer.Portal.Service.Tests - net7.0 + net8.0 enable enable false @@ -32,9 +32,8 @@ - - - + + @@ -46,10 +45,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/tests/externalservices/Portal.Service.Tests/PortalServiceTests.cs b/tests/externalservices/Portal.Service.Tests/PortalServiceTests.cs index 9e5ff4a4..6a1623eb 100644 --- a/tests/externalservices/Portal.Service.Tests/PortalServiceTests.cs +++ b/tests/externalservices/Portal.Service.Tests/PortalServiceTests.cs @@ -80,7 +80,7 @@ public async Task AddNotification_WithValid_DoesNotThrowException() var sut = new PortalService(_tokenService, _options); // Act - await sut.AddNotification("Test", requester, NotificationTypeId.CREDENTIAL_APPROVAL, CancellationToken.None).ConfigureAwait(false); + await sut.AddNotification("Test", requester, NotificationTypeId.CREDENTIAL_APPROVAL, CancellationToken.None); // Assert httpMessageHandlerMock.RequestMessage.Should().Match(x => @@ -110,7 +110,7 @@ public async Task AddNotification_WithConflict_ThrowsServiceExceptionWithErrorCo var sut = new PortalService(_tokenService, _options); // Act - async Task Act() => await sut.AddNotification("Test", requester, NotificationTypeId.CREDENTIAL_APPROVAL, CancellationToken.None).ConfigureAwait(false); + async Task Act() => await sut.AddNotification("Test", requester, NotificationTypeId.CREDENTIAL_APPROVAL, CancellationToken.None); // Assert var ex = await Assert.ThrowsAsync(Act); @@ -136,7 +136,7 @@ public async Task TriggerMail_WithValid_DoesNotThrowException() var sut = new PortalService(_tokenService, _options); // Act - await sut.TriggerMail("Test", requesterId, Enumerable.Empty(), CancellationToken.None).ConfigureAwait(false); + await sut.TriggerMail("Test", requesterId, Enumerable.Empty(), CancellationToken.None); // Assert httpMessageHandlerMock.RequestMessage.Should().Match(x => @@ -165,7 +165,7 @@ public async Task TriggerMail_WithConflict_ThrowsServiceExceptionWithErrorConten var sut = new PortalService(_tokenService, _options); // Act - async Task Act() => await sut.TriggerMail("Test", requesterId, Enumerable.Empty(), CancellationToken.None).ConfigureAwait(false); + async Task Act() => await sut.TriggerMail("Test", requesterId, Enumerable.Empty(), CancellationToken.None); // Assert var ex = await Assert.ThrowsAsync(Act); diff --git a/tests/externalservices/Wallet.Service.Tests/BusinessLogic/WalletBusinessLogicTests.cs b/tests/externalservices/Wallet.Service.Tests/BusinessLogic/WalletBusinessLogicTests.cs index f6a03d27..b29766be 100644 --- a/tests/externalservices/Wallet.Service.Tests/BusinessLogic/WalletBusinessLogicTests.cs +++ b/tests/externalservices/Wallet.Service.Tests/BusinessLogic/WalletBusinessLogicTests.cs @@ -85,7 +85,7 @@ public async Task CreateCredential_CallsExpected() .Returns(externalId); // Act - await _sut.CreateCredential(id, schema, CancellationToken.None).ConfigureAwait(false); + await _sut.CreateCredential(id, schema, CancellationToken.None); // Assert A.CallTo(() => _companySsiDetailRepository.AttachAndModifyCompanySsiDetails(id, A>._, A>._)) @@ -116,7 +116,7 @@ public async Task SignCredential_CallsExpected() .Returns("cred"); // Act - await _sut.SignCredential(id, credentialId, CancellationToken.None).ConfigureAwait(false); + await _sut.SignCredential(id, credentialId, CancellationToken.None); // Assert A.CallTo(() => _companySsiDetailRepository.AttachAndModifyCompanySsiDetails(id, A>._, A>._)) @@ -145,7 +145,7 @@ public async Task CreateCredentialForHolder_CallsExpected() }); // Act - await _sut.CreateCredentialForHolder(id, "https://example.org/wallet", "test1", new EncryptionInformation(secret, vector, 0), "thisisatestsecret", CancellationToken.None).ConfigureAwait(false); + await _sut.CreateCredentialForHolder(id, "https://example.org/wallet", "test1", new EncryptionInformation(secret, vector, 0), "thisisatestsecret", CancellationToken.None); // Assert A.CallTo(() => _companySsiDetailRepository.AttachAndModifyProcessData(id, A>._, A>._)) @@ -199,7 +199,7 @@ public async Task GetCredential_CallsExpected() .Returns(jsonDocument); // Act - await _sut.GetCredential(id, credentialId, VerifiedCredentialTypeKindId.BPN, CancellationToken.None).ConfigureAwait(false); + await _sut.GetCredential(id, credentialId, VerifiedCredentialTypeKindId.BPN, CancellationToken.None); // Assert A.CallTo(() => _documentRepository.CreateDocument(A._, A._, A._, MediaTypeId.JSON, DocumentTypeId.VERIFIED_CREDENTIAL, A>._)) @@ -232,10 +232,10 @@ public async Task GetCredential_WithSchemaNotMatching_CallsExpected() var jsonDocument = JsonDocument.Parse(data); A.CallTo(() => _walletService.GetCredential(credentialId, A._)) .Returns(jsonDocument); - async Task Act() => await _sut.GetCredential(id, credentialId, VerifiedCredentialTypeKindId.BPN, CancellationToken.None).ConfigureAwait(false); + async Task Act() => await _sut.GetCredential(id, credentialId, VerifiedCredentialTypeKindId.BPN, CancellationToken.None); // Act - var ex = await Assert.ThrowsAsync(Act).ConfigureAwait(false); + var ex = await Assert.ThrowsAsync(Act); // Assert ex.Message.Should().Be("Invalid schema for type BPN"); diff --git a/tests/externalservices/Wallet.Service.Tests/Services/BasicAuthTokenServiceTests.cs b/tests/externalservices/Wallet.Service.Tests/Services/BasicAuthTokenServiceTests.cs index 8a72afdd..8082d00e 100644 --- a/tests/externalservices/Wallet.Service.Tests/Services/BasicAuthTokenServiceTests.cs +++ b/tests/externalservices/Wallet.Service.Tests/Services/BasicAuthTokenServiceTests.cs @@ -67,7 +67,7 @@ public async Task GetAuthorizedClient_Success() var sut = new BasicAuthTokenService(_httpClientFactory); - var result = await sut.GetBasicAuthorizedClient(settings, _cancellationToken).ConfigureAwait(false); + var result = await sut.GetBasicAuthorizedClient(settings, _cancellationToken); result.Should().NotBeNull(); result.BaseAddress.Should().Be(_validBaseAddress); @@ -83,7 +83,7 @@ public async Task GetAuthorizedClient_HttpClientThrows_Throws() Task Act() => sut.GetBasicAuthorizedClient(settings, _cancellationToken); - var error = await Assert.ThrowsAsync(Act).ConfigureAwait(false); + var error = await Assert.ThrowsAsync(Act); error.Should().NotBeNull(); error.InnerException.Should().Be(_testException); diff --git a/tests/externalservices/Wallet.Service.Tests/Services/WalletServiceTests.cs b/tests/externalservices/Wallet.Service.Tests/Services/WalletServiceTests.cs index 3ddb3767..08f65963 100644 --- a/tests/externalservices/Wallet.Service.Tests/Services/WalletServiceTests.cs +++ b/tests/externalservices/Wallet.Service.Tests/Services/WalletServiceTests.cs @@ -5,6 +5,7 @@ using Json.More; using Microsoft.Extensions.Options; using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling; +using Org.Eclipse.TractusX.Portal.Backend.Framework.Token; using Org.Eclipse.TractusX.SsiCredentialIssuer.Tests.Shared; using Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service.DependencyInjection; using Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service.Models; @@ -60,7 +61,7 @@ public async Task CreateCredential_WithValid_DoesNotThrowException() .Returns(httpClient); // Act - var result = await _sut.CreateCredential(payload, CancellationToken.None).ConfigureAwait(false); + var result = await _sut.CreateCredential(payload, CancellationToken.None); // Assert httpMessageHandlerMock.RequestMessage.Should().Match(x => @@ -90,7 +91,7 @@ public async Task CreateCredential_WithConflict_ThrowsServiceExceptionWithErrorC A.CallTo(() => _basicAuthTokenService.GetBasicAuthorizedClient(_options.Value, A._)).Returns(httpClient); // Act - async Task Act() => await _sut.CreateCredential(payload, CancellationToken.None).ConfigureAwait(false); + async Task Act() => await _sut.CreateCredential(payload, CancellationToken.None); // Assert var ex = await Assert.ThrowsAsync(Act); @@ -118,7 +119,7 @@ public async Task SignCredential_WithValid_DoesNotThrowException() .Returns(httpClient); // Act - var result = await _sut.SignCredential(credentialId, CancellationToken.None).ConfigureAwait(false); + var result = await _sut.SignCredential(credentialId, CancellationToken.None); // Assert httpMessageHandlerMock.RequestMessage.Should().Match(x => @@ -149,7 +150,7 @@ public async Task SignCredential_WithConflict_ThrowsServiceExceptionWithErrorCon A.CallTo(() => _basicAuthTokenService.GetBasicAuthorizedClient(_options.Value, A._)).Returns(httpClient); // Act - async Task Act() => await _sut.SignCredential(credentialId, CancellationToken.None).ConfigureAwait(false); + async Task Act() => await _sut.SignCredential(credentialId, CancellationToken.None); // Assert var ex = await Assert.ThrowsAsync(Act); @@ -181,7 +182,7 @@ public async Task GetCredential_WithValid_DoesNotThrowException() .Returns(httpClient); // Act - var result = await _sut.GetCredential(credentialId, CancellationToken.None).ConfigureAwait(false); + var result = await _sut.GetCredential(credentialId, CancellationToken.None); // Assert result.RootElement.ToJsonString().Should().Be("{\"root\":\"123\"}"); @@ -206,7 +207,7 @@ public async Task GetCredential_WithConflict_ThrowsServiceExceptionWithErrorCont A.CallTo(() => _basicAuthTokenService.GetBasicAuthorizedClient(_options.Value, A._)).Returns(httpClient); // Act - async Task Act() => await _sut.GetCredential(credentialId, CancellationToken.None).ConfigureAwait(false); + async Task Act() => await _sut.GetCredential(credentialId, CancellationToken.None); // Assert var ex = await Assert.ThrowsAsync(Act); @@ -233,7 +234,7 @@ public async Task CreateCredentialForHolder_WithValid_DoesNotThrowException() .Returns(httpClient); // Act - var result = await _sut.CreateCredentialForHolder("https://example.org", "test", "testSec", "testCred", CancellationToken.None).ConfigureAwait(false); + var result = await _sut.CreateCredentialForHolder("https://example.org", "test", "testSec", "testCred", CancellationToken.None); // Assert httpMessageHandlerMock.RequestMessage.Should().Match(x => @@ -262,7 +263,7 @@ public async Task CreateCredentialForHolder_WithConflict_ThrowsServiceExceptionW A.CallTo(() => _basicAuthTokenService.GetBasicAuthorizedClient(A._, A._)).Returns(httpClient); // Act - async Task Act() => await _sut.CreateCredentialForHolder("https://example.org", "test", "testSec", "testCred", CancellationToken.None).ConfigureAwait(false); + async Task Act() => await _sut.CreateCredentialForHolder("https://example.org", "test", "testSec", "testCred", CancellationToken.None); // Assert var ex = await Assert.ThrowsAsync(Act); @@ -289,7 +290,7 @@ public async Task RevokeCredentialForIssuer_WithValid_DoesNotThrowException() .Returns(httpClient); // Act - await _sut.RevokeCredentialForIssuer(Guid.NewGuid(), CancellationToken.None).ConfigureAwait(false); + await _sut.RevokeCredentialForIssuer(Guid.NewGuid(), CancellationToken.None); // Assert httpMessageHandlerMock.RequestMessage.Should().Match(x => @@ -316,7 +317,7 @@ public async Task RevokeCredentialForIssuer_WithConflict_ThrowsServiceExceptionW A.CallTo(() => _basicAuthTokenService.GetBasicAuthorizedClient(A._, A._)).Returns(httpClient); // Act - async Task Act() => await _sut.RevokeCredentialForIssuer(Guid.NewGuid(), CancellationToken.None).ConfigureAwait(false); + async Task Act() => await _sut.RevokeCredentialForIssuer(Guid.NewGuid(), CancellationToken.None); // Assert var ex = await Assert.ThrowsAsync(Act); diff --git a/tests/externalservices/Wallet.Service.Tests/Wallet.Service.Tests.csproj b/tests/externalservices/Wallet.Service.Tests/Wallet.Service.Tests.csproj index 3a7bd735..7bfb851d 100644 --- a/tests/externalservices/Wallet.Service.Tests/Wallet.Service.Tests.csproj +++ b/tests/externalservices/Wallet.Service.Tests/Wallet.Service.Tests.csproj @@ -21,7 +21,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service.Tests Org.Eclipse.TractusX.SsiCredentialIssuer.Wallet.Service.Tests - net7.0 + net8.0 enable enable false @@ -32,25 +32,20 @@ - - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/tests/issuer/SsiCredentialIssuer.Service.Tests/Authentication/KeycloakClaimsTransformationTests.cs b/tests/issuer/SsiCredentialIssuer.Service.Tests/Authentication/KeycloakClaimsTransformationTests.cs index 45a7a059..2e77c475 100644 --- a/tests/issuer/SsiCredentialIssuer.Service.Tests/Authentication/KeycloakClaimsTransformationTests.cs +++ b/tests/issuer/SsiCredentialIssuer.Service.Tests/Authentication/KeycloakClaimsTransformationTests.cs @@ -55,7 +55,7 @@ public async Task TransformAsync_WithoutRoles_ReturnsExpected() var principal = new ClaimsPrincipal(identity); // Act - var result = await _sut.TransformAsync(principal).ConfigureAwait(false); + var result = await _sut.TransformAsync(principal); // Assert result.Claims.Should().ContainSingle() @@ -71,7 +71,7 @@ public async Task TransformAsync_WithRoles_ReturnsExpected() var principal = new ClaimsPrincipal(identity); // Act - var result = await _sut.TransformAsync(principal).ConfigureAwait(false); + var result = await _sut.TransformAsync(principal); // Assert result.Claims.Should().HaveCount(2).And.Satisfy( @@ -88,7 +88,7 @@ public async Task TransformAsync_WithIntRole_ReturnsExpected() var principal = new ClaimsPrincipal(identity); // Act - var result = await _sut.TransformAsync(principal).ConfigureAwait(false); + var result = await _sut.TransformAsync(principal); // Assert result.Claims.Should().ContainSingle() diff --git a/tests/issuer/SsiCredentialIssuer.Service.Tests/BusinessLogic/IssuerBusinessLogicTests.cs b/tests/issuer/SsiCredentialIssuer.Service.Tests/BusinessLogic/IssuerBusinessLogicTests.cs index bf29dd44..4ea1bf29 100644 --- a/tests/issuer/SsiCredentialIssuer.Service.Tests/BusinessLogic/IssuerBusinessLogicTests.cs +++ b/tests/issuer/SsiCredentialIssuer.Service.Tests/BusinessLogic/IssuerBusinessLogicTests.cs @@ -152,7 +152,7 @@ public async Task GetCredentialsForBpn_ReturnsExpected() Setup_GetCredentialsForBpn(); // Act - var result = await _sut.GetCredentialsForBpn().ToListAsync().ConfigureAwait(false); + var result = await _sut.GetCredentialsForBpn().ToListAsync(); // Assert result.Should().HaveCount(5); diff --git a/tests/issuer/SsiCredentialIssuer.Service.Tests/Controllers/IssuerControllerTests.cs b/tests/issuer/SsiCredentialIssuer.Service.Tests/Controllers/IssuerControllerTests.cs index 14dbf20a..6ddd8436 100644 --- a/tests/issuer/SsiCredentialIssuer.Service.Tests/Controllers/IssuerControllerTests.cs +++ b/tests/issuer/SsiCredentialIssuer.Service.Tests/Controllers/IssuerControllerTests.cs @@ -49,7 +49,7 @@ public IssuerControllerTests(IntegrationTestFactory factory) public async Task GetCertificateTypes() { // Act - var types = await _client.GetFromJsonAsync>($"{BaseUrl}/certificateTypes", JsonOptions).ConfigureAwait(false); + var types = await _client.GetFromJsonAsync>($"{BaseUrl}/certificateTypes", JsonOptions); // Assert types.Should().NotBeNull().And.HaveCount(2).And.Satisfy( @@ -66,7 +66,7 @@ public async Task GetCertificateTypes() public async Task CheckSwagger_ReturnsExpected() { // Act - var response = await _client.GetAsync($"{BaseUrl}/swagger/v1/swagger.json").ConfigureAwait(false); + var response = await _client.GetAsync($"{BaseUrl}/swagger/v1/swagger.json"); // Assert response.Should().NotBeNull(); diff --git a/tests/issuer/SsiCredentialIssuer.Service.Tests/Identity/MandatoryIdentityClaimHandlerTests.cs b/tests/issuer/SsiCredentialIssuer.Service.Tests/Identity/MandatoryIdentityClaimHandlerTests.cs index e2f973d4..15d695e6 100644 --- a/tests/issuer/SsiCredentialIssuer.Service.Tests/Identity/MandatoryIdentityClaimHandlerTests.cs +++ b/tests/issuer/SsiCredentialIssuer.Service.Tests/Identity/MandatoryIdentityClaimHandlerTests.cs @@ -57,7 +57,7 @@ public async Task HandleValidRequirement_WithoutUsername_ReturnsExpected() var sut = new MandatoryIdentityClaimHandler(_claimsIdentityDataBuilder, _logger); // Act - await sut.HandleAsync(context).ConfigureAwait(false); + await sut.HandleAsync(context); // Assert context.HasSucceeded.Should().Be(false); @@ -86,7 +86,7 @@ public async Task HandleValidRequirement_WithAllSet_ReturnsExpected() var sut = new MandatoryIdentityClaimHandler(_claimsIdentityDataBuilder, _logger); // Act - await sut.HandleAsync(context).ConfigureAwait(false); + await sut.HandleAsync(context); // Assert context.HasSucceeded.Should().Be(true); diff --git a/tests/issuer/SsiCredentialIssuer.Service.Tests/SsiCredentialIssuer.Service.Tests.csproj b/tests/issuer/SsiCredentialIssuer.Service.Tests/SsiCredentialIssuer.Service.Tests.csproj index 66667769..0e325a16 100644 --- a/tests/issuer/SsiCredentialIssuer.Service.Tests/SsiCredentialIssuer.Service.Tests.csproj +++ b/tests/issuer/SsiCredentialIssuer.Service.Tests/SsiCredentialIssuer.Service.Tests.csproj @@ -21,7 +21,7 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Service.Tests Org.Eclipse.TractusX.SsiCredentialIssuer.Service.Tests - net7.0 + net8.0 enable enable false @@ -32,9 +32,8 @@ - - - + + @@ -46,10 +45,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/tests/processes/CredentialProcess.Library.Tests/CredentialProcess.Library.Tests.csproj b/tests/processes/CredentialProcess.Library.Tests/CredentialProcess.Library.Tests.csproj index 8ac25f57..e4e0c98a 100644 --- a/tests/processes/CredentialProcess.Library.Tests/CredentialProcess.Library.Tests.csproj +++ b/tests/processes/CredentialProcess.Library.Tests/CredentialProcess.Library.Tests.csproj @@ -19,7 +19,7 @@ - net7.0 + net8.0 enable enable false @@ -27,7 +27,8 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.CredentialProcess.Library.Tests - + + @@ -36,10 +37,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/tests/processes/CredentialProcess.Worker.Tests/CredentialProcess.Worker.Tests.csproj b/tests/processes/CredentialProcess.Worker.Tests/CredentialProcess.Worker.Tests.csproj index 09e4f541..e6bc5f59 100644 --- a/tests/processes/CredentialProcess.Worker.Tests/CredentialProcess.Worker.Tests.csproj +++ b/tests/processes/CredentialProcess.Worker.Tests/CredentialProcess.Worker.Tests.csproj @@ -19,7 +19,7 @@ - net7.0 + net8.0 enable enable false @@ -27,7 +27,8 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.CredentialProcess.Worker.Tests - + + @@ -36,10 +37,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/tests/processes/Processes.Library.Tests/Processes.Library.Tests.csproj b/tests/processes/Processes.Library.Tests/Processes.Library.Tests.csproj index a5652e21..e4619040 100644 --- a/tests/processes/Processes.Library.Tests/Processes.Library.Tests.csproj +++ b/tests/processes/Processes.Library.Tests/Processes.Library.Tests.csproj @@ -19,7 +19,7 @@ - net7.0 + net8.0 enable enable false @@ -27,7 +27,8 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Processes.Library.Tests - + + @@ -36,10 +37,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/tests/processes/Processes.Worker.Library.Tests/ProcessExecutorTests.cs b/tests/processes/Processes.Worker.Library.Tests/ProcessExecutorTests.cs index a9806209..37b82674 100644 --- a/tests/processes/Processes.Worker.Library.Tests/ProcessExecutorTests.cs +++ b/tests/processes/Processes.Worker.Library.Tests/ProcessExecutorTests.cs @@ -80,10 +80,10 @@ public void GetRegisteredProcessTypeIds_ReturnsExpected() public async Task ExecuteProcess_WithInvalidProcessTypeId_Throws() { // Arrange - var Act = async () => await _sut.ExecuteProcess(Guid.NewGuid(), (ProcessTypeId)default, CancellationToken.None).ToListAsync().ConfigureAwait(false); + var Act = async () => await _sut.ExecuteProcess(Guid.NewGuid(), (ProcessTypeId)default, CancellationToken.None).ToListAsync(); // Act - var result = await Assert.ThrowsAsync(Act).ConfigureAwait(false); + var result = await Assert.ThrowsAsync(Act); // Assert result.Message.Should().Be($"processType {(ProcessTypeId)default} is not a registered executable processType."); @@ -170,7 +170,7 @@ public async Task ExecuteProcess_WithInitialSteps_ReturnsExpected(ProcessStepSta }); // Act - var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync().ConfigureAwait(false); + var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync(); // Assert result.Should().HaveSameCount(executionResults).And.ContainInOrder(executionResults); @@ -269,7 +269,7 @@ public async Task ExecuteProcess_NoScheduleOrSkippedSteps_ReturnsExpected(Proces }); // Act - var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync().ConfigureAwait(false); + var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync(); // Assert result.Should().HaveSameCount(executionResults).And.ContainInOrder(executionResults); @@ -313,7 +313,7 @@ public async Task ExecuteProcess_NoExecutableSteps_ReturnsExpected() .Returns(new IProcessTypeExecutor.InitializationResult(false, null)); // Act - var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync().ConfigureAwait(false); + var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync(); // Assert result.Should().HaveCount(1).And.Contain(IProcessExecutor.ProcessExecutionResult.Unmodified); @@ -381,7 +381,7 @@ public async Task ExecuteProcess_NoScheduleOrSkippedSteps_SingleStepTypeWithDupl }); // Act - var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync().ConfigureAwait(false); + var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync(); // Assert result.Should().HaveSameCount(executionResults).And.ContainInOrder(executionResults); @@ -497,7 +497,7 @@ public async Task ExecuteProcess_WithScheduledSteps_ReturnsExpected(ProcessStepS }); // Act - var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync().ConfigureAwait(false); + var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync(); // Assert result. @@ -605,7 +605,7 @@ public async Task ExecuteProcess_WithDuplicateScheduledSteps_ReturnsExpected(Pro }); // Act - var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync().ConfigureAwait(false); + var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync(); result.Should().HaveSameCount(executionResults).And.ContainInOrder(executionResults); @@ -694,7 +694,7 @@ public async Task ExecuteProcess_WithSkippedSteps_ReturnsExpected(ProcessStepSta }); // Act - var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync().ConfigureAwait(false); + var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync(); // Assert result.Should().HaveSameCount(executionResults).And.ContainInOrder(executionResults); @@ -784,7 +784,7 @@ public async Task ExecuteProcess_ProcessThrowsTestException_ReturnsExpected(bool }); // Act - var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync().ConfigureAwait(false); + var result = await _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ToListAsync(); // Assert result.Should().HaveSameCount(executionResults).And.ContainInOrder(executionResults); @@ -840,14 +840,14 @@ public async Task ExecuteProcess_ProcessThrowsSystemException_Throws(bool isLock var Act = async () => { - await foreach (var stepResult in _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None).ConfigureAwait(false)) + await foreach (var stepResult in _sut.ExecuteProcess(processId, ProcessTypeId.CREATE_CREDENTIAL, CancellationToken.None)) { stepResults.Add(stepResult); } }; // Act - var result = await Assert.ThrowsAsync(Act).ConfigureAwait(false); + var result = await Assert.ThrowsAsync(Act); // Assert stepResults.Should().HaveSameCount(executionResults).And.ContainInOrder(executionResults); diff --git a/tests/processes/Processes.Worker.Library.Tests/Processes.Worker.Library.Tests.csproj b/tests/processes/Processes.Worker.Library.Tests/Processes.Worker.Library.Tests.csproj index c5e5b725..247d4f0d 100644 --- a/tests/processes/Processes.Worker.Library.Tests/Processes.Worker.Library.Tests.csproj +++ b/tests/processes/Processes.Worker.Library.Tests/Processes.Worker.Library.Tests.csproj @@ -19,7 +19,7 @@ - net7.0 + net8.0 enable enable false @@ -27,7 +27,8 @@ Org.Eclipse.TractusX.SsiCredentialIssuer.Processes.Worker.Library.Tests - + + @@ -36,10 +37,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all -