diff --git a/CustomAnalysisRules.ruleset b/CustomAnalysisRules.ruleset
index b51b4865c3..c41f91fb0b 100644
--- a/CustomAnalysisRules.ruleset
+++ b/CustomAnalysisRules.ruleset
@@ -24,6 +24,13 @@
+
+
+
+
+
+
+
diff --git a/Directory.Build.props b/Directory.Build.props
index ccda88097c..b20c04f4a5 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -13,13 +13,13 @@
true
latest
true
- $(NoWarn);NU5104;CS1574;IDE0005
+ $(NoWarn);NU5104;NU1510;CS1574;IDE0005;ASPDEPR008;ASPDEPR006;ASPDEPR003;ASPDEPR005;CA2024
MIT
Microsoft FHIR Server for Azure
true
https://github.com/microsoft/fhir-server
$(MSBuildThisFileDirectory)\CodeCoverage.runsettings
- net9.0;net8.0
+ net10.0;net8.0
true
true
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 9ee3ddb290..a9ef14fd17 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -1,10 +1,10 @@
- 10.0.68
+ 11.0.3
5.11.4
5.11.0
- 9.0.6
+ 10.0.0
6.2.0
@@ -19,9 +19,15 @@
9.0.3
+
+
+ 10.0.0
+
+
+
@@ -34,7 +40,7 @@
-
+
@@ -60,7 +66,7 @@
-
+
@@ -71,7 +77,7 @@
-
+
@@ -140,4 +146,4 @@
-
+
\ No newline at end of file
diff --git a/THIRDPARTYNOTICES.md b/THIRDPARTYNOTICES.md
index 379fc02b91..257d951f34 100644
--- a/THIRDPARTYNOTICES.md
+++ b/THIRDPARTYNOTICES.md
@@ -539,8 +539,8 @@ This file is based on or incorporates material from the projects listed below (T
> limitations under the License.
>
-## MediatR 9.0.0
-* Component Source: https://github.com/jbogard/MediatR
+## Medino 3.0.2
+* Component Source: https://github.com/brendankowitz/Medino
* Component Copyright and License:
> Apache License
> Version 2.0, January 2004
diff --git a/build/build-variables.yml b/build/build-variables.yml
index 75699622d0..c33283af4d 100644
--- a/build/build-variables.yml
+++ b/build/build-variables.yml
@@ -5,7 +5,8 @@ variables:
buildConfiguration: 'Release'
publicDockerImagePlatforms: 'linux/amd64,linux/arm64'
testDockerImagePlatforms: 'linux/amd64'
- defaultBuildFramework: 'net9.0'
+ # Use .NET 10 SDK to support SQL script generation tool, target net10.0
+ defaultBuildFramework: 'net10.0'
azureSubscriptionEndpoint: 'docker-build'
azureContainerRegistryName: 'healthplatformregistry'
azureContainerRegistry: '$(azureContainerRegistryName).azurecr.io'
diff --git a/build/ci-pipeline.yml b/build/ci-pipeline.yml
index 7733bb5a3e..4889e1ef08 100644
--- a/build/ci-pipeline.yml
+++ b/build/ci-pipeline.yml
@@ -65,7 +65,7 @@ stages:
majorMinorPatch: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.majorMinorPatch']]
nuGetVersion: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.nuGetVersion']]
jobs:
- - job: Windows_dotnet9
+ - job: Windows_dotnet10
pool:
name: '$(DefaultWindowsPool)'
demands:
diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile
index 2181374970..993bf88c56 100644
--- a/build/docker/Dockerfile
+++ b/build/docker/Dockerfile
@@ -1,5 +1,6 @@
# --platform tells docker to always use the host platform for the build not the target platform. Runtime container will use target platform.
-FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0.306-azurelinux3.0 AS build
+# Use .NET 10 SDK to support SQL script generation tool, targeting net10.0 and net8.0 in builds
+FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.100-azurelinux3.0 AS build
ARG TARGETARCH
ARG FHIR_VERSION
ARG ASSEMBLY_VER
@@ -77,10 +78,10 @@ RUN dotnet restore ./src/Microsoft.Health.Fhir.${FHIR_VERSION}.Web/Microsoft.Hea
COPY . .
-RUN dotnet publish /repo/src/Microsoft.Health.Fhir.${FHIR_VERSION}.Web/Microsoft.Health.Fhir.${FHIR_VERSION}.Web.csproj -o "/build" --no-restore -p:AssemblyVersion="${ASSEMBLY_VER}" -p:FileVersion="${ASSEMBLY_VER}" -p:Version="${ASSEMBLY_VER}" -f net9.0 -a $TARGETARCH
+RUN dotnet publish /repo/src/Microsoft.Health.Fhir.${FHIR_VERSION}.Web/Microsoft.Health.Fhir.${FHIR_VERSION}.Web.csproj -o "/build" --no-restore -p:AssemblyVersion="${ASSEMBLY_VER}" -p:FileVersion="${ASSEMBLY_VER}" -p:Version="${ASSEMBLY_VER}" -f net10.0 -a $TARGETARCH
# Implicitly uses the target platform for the runtime image.
-FROM mcr.microsoft.com/dotnet/aspnet:9.0.10-azurelinux3.0 AS runtime
+FROM mcr.microsoft.com/dotnet/aspnet:10.0.0-azurelinux3.0 AS runtime
ARG FHIR_VERSION
diff --git a/build/dotnet8-compat/global.json b/build/dotnet8-compat/global.json
index bb0a2659e6..2c94190a91 100644
--- a/build/dotnet8-compat/global.json
+++ b/build/dotnet8-compat/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "8.0.415"
+ "version": "8.0.416"
}
}
diff --git a/build/dotnet9-compat/global.json b/build/dotnet9-compat/global.json
new file mode 100644
index 0000000000..9128fc8e67
--- /dev/null
+++ b/build/dotnet9-compat/global.json
@@ -0,0 +1,5 @@
+{
+ "sdk": {
+ "version": "9.0.307"
+ }
+}
diff --git a/build/jobs/analyze.yml b/build/jobs/analyze.yml
index f8e2a8c7c7..b1c7f2266f 100644
--- a/build/jobs/analyze.yml
+++ b/build/jobs/analyze.yml
@@ -110,7 +110,7 @@ steps:
inputs:
userProvideBuildInfo: 'msBuildInfo'
msBuildArchitecture: 'DotNetCore'
- msBuildCommandline: 'dotnet build $(Build.SourcesDirectory)/Microsoft.Health.Fhir.sln --configuration $(buildConfiguration) -p:ContinuousIntegrationBuild=true -f net9.0'
+ msBuildCommandline: 'dotnet build $(Build.SourcesDirectory)/Microsoft.Health.Fhir.sln --configuration $(buildConfiguration) -p:ContinuousIntegrationBuild=true -f net10.0'
- task: BinSkim@4
inputs:
diff --git a/build/pr-pipeline.yml b/build/pr-pipeline.yml
index 6e582582a5..58b5641c73 100644
--- a/build/pr-pipeline.yml
+++ b/build/pr-pipeline.yml
@@ -37,7 +37,7 @@ stages:
majorMinorPatch: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.majorMinorPatch']]
nuGetVersion: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.nuGetVersion']]
jobs:
- - job: Windows_dotnet9
+ - job: Windows_dotnet10
pool:
name: '$(DefaultWindowsPool)'
demands:
diff --git a/global.json b/global.json
index feffdd4ee5..481e95ec7b 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "9.0.306"
+ "version": "10.0.100"
}
}
diff --git a/src/Microsoft.Health.Fhir.Api/Features/ApiNotifications/ApiNotificationMiddleware.cs b/src/Microsoft.Health.Fhir.Api/Features/ApiNotifications/ApiNotificationMiddleware.cs
index 2fd4f8efba..005ce4de86 100644
--- a/src/Microsoft.Health.Fhir.Api/Features/ApiNotifications/ApiNotificationMiddleware.cs
+++ b/src/Microsoft.Health.Fhir.Api/Features/ApiNotifications/ApiNotificationMiddleware.cs
@@ -8,7 +8,7 @@
using System.Threading;
using System.Threading.Tasks;
using EnsureThat;
-using MediatR;
+using Medino;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Health.Core;
@@ -79,7 +79,7 @@ protected virtual async Task PublishNotificationAsync(HttpContext context, Reque
apiNotification.ResourceType = fhirRequestContext.ResourceType;
apiNotification.StatusCode = (HttpStatusCode)context.Response.StatusCode;
- await _mediator.Publish(apiNotification, CancellationToken.None);
+ await _mediator.PublishAsync(apiNotification, CancellationToken.None);
}
}
catch (Exception e)
diff --git a/src/Microsoft.Health.Fhir.Api/Features/ApiNotifications/ApiResponseNotification.cs b/src/Microsoft.Health.Fhir.Api/Features/ApiNotifications/ApiResponseNotification.cs
index 4c4016b2b8..43de04cb6e 100644
--- a/src/Microsoft.Health.Fhir.Api/Features/ApiNotifications/ApiResponseNotification.cs
+++ b/src/Microsoft.Health.Fhir.Api/Features/ApiNotifications/ApiResponseNotification.cs
@@ -10,9 +10,9 @@
namespace Microsoft.Health.Fhir.Api.Features.ApiNotifications
{
///
- /// A Mediatr message containing information about API responses.
+ /// A Medino message containing information about API responses.
/// This gets emitted by the ApiNotificationMiddleware when a response is returned by the server.
- /// Consume these using Mediatr to collect stats about API responses.
+ /// Consume these using Medino to collect stats about API responses.
///
public class ApiResponseNotification : IMetricsNotification
{
diff --git a/src/Microsoft.Health.Fhir.Api/Features/BackgroundJobService/HostingBackgroundService.cs b/src/Microsoft.Health.Fhir.Api/Features/BackgroundJobService/HostingBackgroundService.cs
index 2cca05b170..ca7312246b 100644
--- a/src/Microsoft.Health.Fhir.Api/Features/BackgroundJobService/HostingBackgroundService.cs
+++ b/src/Microsoft.Health.Fhir.Api/Features/BackgroundJobService/HostingBackgroundService.cs
@@ -10,7 +10,7 @@
using System.Threading;
using System.Threading.Tasks;
using EnsureThat;
-using MediatR;
+using Medino;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
@@ -94,7 +94,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
}
}
- public Task Handle(SearchParametersInitializedNotification notification, CancellationToken cancellationToken)
+ public Task HandleAsync(SearchParametersInitializedNotification notification, CancellationToken cancellationToken)
{
_storageReady = true;
return Task.CompletedTask;
diff --git a/src/Microsoft.Health.Fhir.Api/Features/ExceptionNotifications/ExceptionNotification.cs b/src/Microsoft.Health.Fhir.Api/Features/ExceptionNotifications/ExceptionNotification.cs
index afd8f4d426..3b950b1192 100644
--- a/src/Microsoft.Health.Fhir.Api/Features/ExceptionNotifications/ExceptionNotification.cs
+++ b/src/Microsoft.Health.Fhir.Api/Features/ExceptionNotifications/ExceptionNotification.cs
@@ -10,8 +10,8 @@
namespace Microsoft.Health.Fhir.Api.Features.ExceptionNotifications
{
///
- /// A MediatR message containing information about exceptions with the context of the current request.
- /// Consume these using MediatR to collect stats about exceptions.
+ /// A Medino message containing information about exceptions with the context of the current request.
+ /// Consume these using Medino to collect stats about exceptions.
///
public class ExceptionNotification : IMetricsNotification
{
diff --git a/src/Microsoft.Health.Fhir.Api/Features/ExceptionNotifications/ExceptionNotificationMiddleware.cs b/src/Microsoft.Health.Fhir.Api/Features/ExceptionNotifications/ExceptionNotificationMiddleware.cs
index 0408f0c636..2de5a996b7 100644
--- a/src/Microsoft.Health.Fhir.Api/Features/ExceptionNotifications/ExceptionNotificationMiddleware.cs
+++ b/src/Microsoft.Health.Fhir.Api/Features/ExceptionNotifications/ExceptionNotificationMiddleware.cs
@@ -7,7 +7,7 @@
using System.Net;
using System.Threading;
using EnsureThat;
-using MediatR;
+using Medino;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Health.Core.Features.Context;
@@ -72,7 +72,7 @@ public async Task Invoke(HttpContext context)
exceptionNotification.IsRequestRateExceeded = exception.IsRequestRateExceeded();
exceptionNotification.BaseException = exception;
- await _mediator.Publish(exceptionNotification, CancellationToken.None);
+ await _mediator.PublishAsync(exceptionNotification, CancellationToken.None);
}
catch (Exception e)
{
diff --git a/src/Microsoft.Health.Fhir.Api/Features/Health/ImproperBehaviorHealthCheck.cs b/src/Microsoft.Health.Fhir.Api/Features/Health/ImproperBehaviorHealthCheck.cs
index 4382c7ab7b..3ca548d5d6 100644
--- a/src/Microsoft.Health.Fhir.Api/Features/Health/ImproperBehaviorHealthCheck.cs
+++ b/src/Microsoft.Health.Fhir.Api/Features/Health/ImproperBehaviorHealthCheck.cs
@@ -5,7 +5,7 @@
using System.Threading;
using System.Threading.Tasks;
-using MediatR;
+using Medino;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Health.Fhir.Core.Features.Health;
@@ -26,7 +26,7 @@ public Task CheckHealthAsync(HealthCheckContext context, Canc
return Task.FromResult(new HealthCheckResult(HealthStatus.Unhealthy, "Improper server behavior has been detected." + _message));
}
- public Task Handle(ImproperBehaviorNotification notification, CancellationToken cancellationToken)
+ public Task HandleAsync(ImproperBehaviorNotification notification, CancellationToken cancellationToken)
{
_isHealthy = false;
_message += " " + notification.Message;
diff --git a/src/Microsoft.Health.Fhir.Api/Features/Health/StorageInitializedHealthCheck.cs b/src/Microsoft.Health.Fhir.Api/Features/Health/StorageInitializedHealthCheck.cs
index 9b90d7d316..c7fdb37ffe 100644
--- a/src/Microsoft.Health.Fhir.Api/Features/Health/StorageInitializedHealthCheck.cs
+++ b/src/Microsoft.Health.Fhir.Api/Features/Health/StorageInitializedHealthCheck.cs
@@ -7,7 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
using EnsureThat;
-using MediatR;
+using Medino;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Health.Core;
using Microsoft.Health.Fhir.Core.Extensions;
@@ -54,7 +54,7 @@ public Task CheckHealthAsync(HealthCheckContext context, Canc
return Task.FromResult(new HealthCheckResult(HealthStatus.Unhealthy, $"Storage has not been initialized. Waited: {(int)waited.TotalSeconds}s."));
}
- public Task Handle(SearchParametersInitializedNotification notification, CancellationToken cancellationToken)
+ public Task HandleAsync(SearchParametersInitializedNotification notification, CancellationToken cancellationToken)
{
_storageReady = true;
return Task.CompletedTask;
diff --git a/src/Microsoft.Health.Fhir.Api/Microsoft.Health.Fhir.Api.csproj b/src/Microsoft.Health.Fhir.Api/Microsoft.Health.Fhir.Api.csproj
index 7d946c1662..38264520cb 100644
--- a/src/Microsoft.Health.Fhir.Api/Microsoft.Health.Fhir.Api.csproj
+++ b/src/Microsoft.Health.Fhir.Api/Microsoft.Health.Fhir.Api.csproj
@@ -15,7 +15,7 @@
-
+
diff --git a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/BulkDeleteProcessingJobTests.cs b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/BulkDeleteProcessingJobTests.cs
index 6c1f174e16..399d2928d7 100644
--- a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/BulkDeleteProcessingJobTests.cs
+++ b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/BulkDeleteProcessingJobTests.cs
@@ -8,7 +8,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-using MediatR;
+using Medino;
using Microsoft.Health.Core.Features.Context;
using Microsoft.Health.Fhir.Core.Features.Context;
using Microsoft.Health.Fhir.Core.Features.Operations;
diff --git a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/CancelBulkDeleteHandlerTests.cs b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/CancelBulkDeleteHandlerTests.cs
index bf3fd5c705..8712342bef 100644
--- a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/CancelBulkDeleteHandlerTests.cs
+++ b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/CancelBulkDeleteHandlerTests.cs
@@ -1,4 +1,4 @@
-// -------------------------------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
// -------------------------------------------------------------------------------------------------
@@ -111,7 +111,7 @@ public async Task GivenUnauthorizedDeleteUser_WhenCancelationIsRequested_ThenUna
_authorizationService.CheckAccess(Arg.Any(), Arg.Any()).Returns(DataActions.Read);
var request = new CancelBulkDeleteRequest(1);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
[Fact]
@@ -121,7 +121,7 @@ public async Task GivenNonExistantBulkDeleteJob_WhenCancelationIsRequested_ThenN
_queueClient.GetJobByGroupIdAsync((byte)QueueType.BulkDelete, Arg.Any(), false, Arg.Any()).Returns(new List());
var request = new CancelBulkDeleteRequest(1);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
private async Task RunBulkDeleteTest(IReadOnlyList jobs, HttpStatusCode expectedStatus)
@@ -134,12 +134,12 @@ private async Task RunBulkDeleteTest(IReadOnlyList jobs, HttpStatusCode
if (expectedStatus == HttpStatusCode.Conflict)
{
- OperationFailedException operationFailedException = await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ OperationFailedException operationFailedException = await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
Assert.Equal(HttpStatusCode.Conflict, operationFailedException.ResponseStatusCode);
}
else
{
- var response = await _handler.Handle(request, CancellationToken.None);
+ var response = await _handler.HandleAsync(request, CancellationToken.None);
Assert.Equal(expectedStatus, response.StatusCode);
if (expectedStatus == HttpStatusCode.Accepted)
diff --git a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/CreateBulkDeleteHandlerTests.cs b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/CreateBulkDeleteHandlerTests.cs
index acf3a40fcd..9543119244 100644
--- a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/CreateBulkDeleteHandlerTests.cs
+++ b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/CreateBulkDeleteHandlerTests.cs
@@ -1,4 +1,4 @@
-// -------------------------------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
// -------------------------------------------------------------------------------------------------
@@ -94,7 +94,7 @@ public async Task GivenBulkDeleteRequest_WhenJobCreationRequested_ThenJobIsCreat
var request = new CreateBulkDeleteRequest(DeleteOperation.HardDelete, KnownResourceTypes.Patient, searchParams, false, null, false);
- var response = await _handler.Handle(request, CancellationToken.None);
+ var response = await _handler.HandleAsync(request, CancellationToken.None);
Assert.NotNull(response);
Assert.Equal(1, response.Id);
await _queueClient.ReceivedWithAnyArgs(1).EnqueueAsync((byte)QueueType.BulkDelete, Arg.Any(), Arg.Any(), false, Arg.Any());
@@ -113,7 +113,7 @@ public async Task GivenBulkDeleteRequestWithInvalidSearchParameter_WhenJobCreati
var request = new CreateBulkDeleteRequest(DeleteOperation.HardDelete, KnownResourceTypes.Patient, searchParams, false, null, false);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
[Theory]
@@ -125,7 +125,7 @@ public async Task GivenUnauthorizedUser_WhenJobCreationRequested_ThenUnauthorize
_authorizationService.CheckAccess(Arg.Any(), Arg.Any()).Returns(userRole);
var request = new CreateBulkDeleteRequest(deleteOperation, null, null, false, null, false);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
[Fact]
@@ -136,7 +136,7 @@ public async Task GivenBulkDeleteRequest_WhenJobCreationFails_ThenExceptionIsThr
_queueClient.EnqueueAsync((byte)QueueType.BulkDelete, Arg.Any(), Arg.Any(), false, Arg.Any()).Returns(new List());
var request = new CreateBulkDeleteRequest(DeleteOperation.HardDelete, null, new List>(), false, null, false);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
}
}
diff --git a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/GetBulkDeleteHandlerTests.cs b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/GetBulkDeleteHandlerTests.cs
index f4a4f73e95..6a7e91954e 100644
--- a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/GetBulkDeleteHandlerTests.cs
+++ b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkDelete/GetBulkDeleteHandlerTests.cs
@@ -1,4 +1,4 @@
-// -------------------------------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
// -------------------------------------------------------------------------------------------------
@@ -261,7 +261,7 @@ public async Task GivenUnauthorizedUser_WhenStatusRequested_ThenUnauthorizedIsRe
_authorizationService.CheckAccess(Arg.Any(), Arg.Any()).Returns(DataActions.None);
var request = new GetBulkDeleteRequest(1);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
[Fact]
@@ -271,7 +271,7 @@ public async Task GivenNonExistantBulkDeleteJob_WhenStatusRequested_ThenNotFound
_queueClient.GetJobByGroupIdAsync((byte)QueueType.BulkDelete, Arg.Any(), false, Arg.Any()).Returns(new List());
var request = new GetBulkDeleteRequest(1);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
private async Task RunGetBulkDeleteTest(IReadOnlyList> jobs, GetBulkDeleteResponse expectedResponse)
@@ -286,7 +286,7 @@ private async Task RunGetBulkDeleteTest(IReadOnlyList> jobs,
_queueClient.GetJobByGroupIdAsync((byte)QueueType.BulkDelete, Arg.Any(), true, Arg.Any()).Returns(jobs.Select(job => job.Item1).ToList());
var request = new GetBulkDeleteRequest(1);
- var response = await _handler.Handle(request, CancellationToken.None);
+ var response = await _handler.HandleAsync(request, CancellationToken.None);
Assert.Equal(expectedResponse.HttpStatusCode, response.HttpStatusCode);
diff --git a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkUpdate/BulkUpdateProcessingJobTests.cs b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkUpdate/BulkUpdateProcessingJobTests.cs
index 8e346d2610..66596638c7 100644
--- a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkUpdate/BulkUpdateProcessingJobTests.cs
+++ b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkUpdate/BulkUpdateProcessingJobTests.cs
@@ -9,7 +9,7 @@
using System.Threading;
using System.Threading.Tasks;
using Hl7.Fhir.Rest;
-using MediatR;
+using Medino;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
@@ -82,7 +82,7 @@ public async Task GivenProcessingJob_WhenJobIsRun_ThenResourcesAreUpdated()
Assert.Equal(2, result.ResourcesIgnored["CarePlan"]);
await _updater.ReceivedWithAnyArgs(1).UpdateMultipleAsync(Arg.Any(), Arg.Any(), Arg.Any(), 0, Arg.Is(b => !b), Arg.Any>>(), Arg.Any(), Arg.Any());
- await _mediator.Received(1).Publish(Arg.Is(n => n.JobId == jobInfo.Id && n.ResourcesUpdated == 4), Arg.Any());
+ await _mediator.Received(1).PublishAsync(Arg.Is(n => n.JobId == jobInfo.Id && n.ResourcesUpdated == 4), Arg.Any());
}
[Theory]
@@ -150,7 +150,7 @@ public async Task GivenProcessingJobWithSurrogateIds_WhenJobIsRun_ThenIdsAreAdde
Assert.Equal(3, result.ResourcesUpdated["Patient"]);
await _updater.ReceivedWithAnyArgs(1).UpdateMultipleAsync(Arg.Any(), Arg.Any(), Arg.Any(), 0, Arg.Any(), Arg.Any>>(), Arg.Any(), Arg.Any());
- await _mediator.Received(1).Publish(Arg.Is(n => n.JobId == jobInfo.Id && n.ResourcesUpdated == 3), Arg.Any());
+ await _mediator.Received(1).PublishAsync(Arg.Is(n => n.JobId == jobInfo.Id && n.ResourcesUpdated == 3), Arg.Any());
}
[Theory]
@@ -287,7 +287,7 @@ public async Task GivenProcessingJobLastOneFromGroupAndProfileResourceTypeIsUpda
Assert.Equal(3, result.ResourcesUpdated["Patient"]);
await _updater.ReceivedWithAnyArgs(1).UpdateMultipleAsync(Arg.Any(), Arg.Any(), Arg.Any(), 0, Arg.Any(), Arg.Any>>(), Arg.Any(), Arg.Any());
- await _mediator.Received(1).Publish(Arg.Is(n => n.JobId == jobs[1].Id && n.ResourcesUpdated == 3), Arg.Any());
+ await _mediator.Received(1).PublishAsync(Arg.Is(n => n.JobId == jobs[1].Id && n.ResourcesUpdated == 3), Arg.Any());
_supportedProfilesStore.Received(1).Refresh();
}
@@ -329,7 +329,7 @@ public async Task GivenProcessingJobLastOneFromGroupAndProfileResourceTypeIsUpda
Assert.Equal(3, result.ResourcesUpdated["StructureDefinition"]);
await _updater.ReceivedWithAnyArgs(1).UpdateMultipleAsync(Arg.Any(), Arg.Any(), Arg.Any(), 0, Arg.Any(), Arg.Any>>(), Arg.Any(), Arg.Any());
- await _mediator.Received(1).Publish(Arg.Is(n => n.JobId == jobs[1].Id && n.ResourcesUpdated == 3), Arg.Any());
+ await _mediator.Received(1).PublishAsync(Arg.Is(n => n.JobId == jobs[1].Id && n.ResourcesUpdated == 3), Arg.Any());
_supportedProfilesStore.Received(1).Refresh();
}
@@ -372,7 +372,7 @@ public async Task GivenProcessingJobLastOneFromGroupAndProfileResourceTypeIsNotU
Assert.Equal(3, result.ResourcesUpdated["Patient"]);
await _updater.ReceivedWithAnyArgs(1).UpdateMultipleAsync(Arg.Any(), Arg.Any(), Arg.Any(), 0, Arg.Any(), Arg.Any>>(), Arg.Any(), Arg.Any());
- await _mediator.Received(1).Publish(Arg.Is(n => n.JobId == jobs[1].Id && n.ResourcesUpdated == 3), Arg.Any());
+ await _mediator.Received(1).PublishAsync(Arg.Is(n => n.JobId == jobs[1].Id && n.ResourcesUpdated == 3), Arg.Any());
_supportedProfilesStore.DidNotReceiveWithAnyArgs().Refresh();
}
@@ -412,7 +412,7 @@ public async Task GivenProcessingJobNotTheLastOneFromGroupAndProfileResourceType
Assert.Equal(3, result.ResourcesUpdated["StructureDefinition"]);
await _updater.ReceivedWithAnyArgs(1).UpdateMultipleAsync(Arg.Any(), Arg.Any(), Arg.Any(), 0, Arg.Any(), Arg.Any>>(), Arg.Any(), Arg.Any());
- await _mediator.Received(1).Publish(Arg.Is(n => n.JobId == jobs[1].Id && n.ResourcesUpdated == 3), Arg.Any());
+ await _mediator.Received(1).PublishAsync(Arg.Is(n => n.JobId == jobs[1].Id && n.ResourcesUpdated == 3), Arg.Any());
_supportedProfilesStore.DidNotReceiveWithAnyArgs().Refresh();
}
@@ -444,7 +444,7 @@ public async Task GivenProcessingJobWhenIncompleteOperationExceptionIsThrown_Whe
Assert.Contains(exceptionMessage, errorResult.Issues);
Assert.Equal(1, errorResult.ResourcesPatchFailed["Patient"]);
- await _mediator.Received(1).Publish(Arg.Is(n => n.JobId == jobInfo.Id && n.ResourcesUpdated == 2), Arg.Any());
+ await _mediator.Received(1).PublishAsync(Arg.Is(n => n.JobId == jobInfo.Id && n.ResourcesUpdated == 2), Arg.Any());
}
[Fact]
@@ -475,7 +475,7 @@ public async Task GivenProcessingJobWhenResourcesPatchFailedIsNotEmpty_WhenJobIs
Assert.Equal(2, errorResult.ResourcesIgnored["StructureDefinition"]);
Assert.Equal(1, errorResult.ResourcesPatchFailed["Patient"]);
- await _mediator.Received(1).Publish(Arg.Is(n => n.JobId == jobInfo.Id && n.ResourcesUpdated == 2), Arg.Any());
+ await _mediator.Received(1).PublishAsync(Arg.Is(n => n.JobId == jobInfo.Id && n.ResourcesUpdated == 2), Arg.Any());
_supportedProfilesStore.DidNotReceiveWithAnyArgs().Refresh();
}
@@ -504,7 +504,7 @@ public async Task GivenProcessingJobWhenNoResourcesUpdatedAndNoErrors_WhenJobIsR
Assert.Empty(result.ResourcesPatchFailed);
Assert.Empty(result.Issues);
- await _mediator.DidNotReceiveWithAnyArgs().Publish(Arg.Any(), Arg.Any());
+ await _mediator.DidNotReceiveWithAnyArgs().PublishAsync(Arg.Any(), Arg.Any());
}
[Fact]
@@ -526,7 +526,7 @@ public async Task GivenProcessingJobWhenUnexpectedExceptionIsThrownFromUpdateMul
// Act & Assert
var ex = await Assert.ThrowsAsync(() => _processingJob.ExecuteAsync(jobInfo, CancellationToken.None));
Assert.Equal("Unexpected error", ex.Message);
- await _mediator.DidNotReceiveWithAnyArgs().Publish(Arg.Any(), Arg.Any());
+ await _mediator.DidNotReceiveWithAnyArgs().PublishAsync(Arg.Any(), Arg.Any());
}
[Fact]
@@ -617,7 +617,7 @@ public async Task GivenProcessingJob_WhenMediatorThrowsException_ThenExceptionIs
_updater.UpdateMultipleAsync(Arg.Any(), Arg.Any(), Arg.Any(), 0, Arg.Any(), Arg.Any>>(), Arg.Any(), Arg.Any())
.Returns(args => substituteResults);
- _mediator.Publish(Arg.Any(), Arg.Any())
+ _mediator.PublishAsync(Arg.Any(), Arg.Any())
.Throws(new InvalidOperationException("Mediator error"));
await Assert.ThrowsAsync(() => _processingJob.ExecuteAsync(jobInfo, CancellationToken.None));
diff --git a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkUpdate/CancelBulkUpdateHandlerTests.cs b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkUpdate/CancelBulkUpdateHandlerTests.cs
index 588b179d23..216a07fa1e 100644
--- a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkUpdate/CancelBulkUpdateHandlerTests.cs
+++ b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Operations/BulkUpdate/CancelBulkUpdateHandlerTests.cs
@@ -1,4 +1,4 @@
-// -------------------------------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
// -------------------------------------------------------------------------------------------------
@@ -126,7 +126,7 @@ public async Task GivenCompletedJobWithProfileResourceUpdate_WhenCancelationIsRe
.Returns(DataActions.BulkOperator);
var request = new CancelBulkUpdateRequest(1);
- await _handler.Handle(request, CancellationToken.None);
+ await _handler.HandleAsync(request, CancellationToken.None);
_supportedProfiles.Received(1).Refresh();
}
@@ -161,7 +161,7 @@ public async Task GivenSoftFailedJobWithProfileResourceUpdate_WhenCancelationIsR
.Returns(DataActions.BulkOperator);
var request = new CancelBulkUpdateRequest(1);
- await _handler.Handle(request, CancellationToken.None);
+ await _handler.HandleAsync(request, CancellationToken.None);
_supportedProfiles.Received(1).Refresh();
}
@@ -172,7 +172,7 @@ public async Task GivenUnauthorizedDeleteUser_WhenCancelationIsRequested_ThenUna
_authorizationService.CheckAccess(Arg.Any(), Arg.Any()).Returns(DataActions.Write);
var request = new CancelBulkUpdateRequest(1);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
[Fact]
@@ -182,7 +182,7 @@ public async Task GivenNonExistantBulkUpdateJob_WhenCancelationIsRequested_ThenN
_queueClient.GetJobByGroupIdAsync((byte)QueueType.BulkUpdate, Arg.Any(), false, Arg.Any()).Returns(new List());
var request = new CancelBulkUpdateRequest(1);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
[Fact]
@@ -193,7 +193,7 @@ public async Task GivenBulkUpdateJob_WhenQueueClientThrowsException_ThenExceptio
.Throws(new System.InvalidOperationException("Unexpected error"));
var request = new CancelBulkUpdateRequest(1);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
[Fact]
@@ -202,7 +202,7 @@ public async Task GivenBulkUpdateJob_WhenUserHasPartialAccess_ThenUnauthorizedFh
_authorizationService.CheckAccess(Arg.Any(), Arg.Any()).Returns(DataActions.Read);
var request = new CancelBulkUpdateRequest(1);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
[Fact]
@@ -213,7 +213,7 @@ public async Task GivenBulkUpdateJobWithNoJobsInGroup_WhenCancelationIsRequested
.Returns(new List());
var request = new CancelBulkUpdateRequest(1);
- await Assert.ThrowsAsync(async () => await _handler.Handle(request, CancellationToken.None));
+ await Assert.ThrowsAsync(async () => await _handler.HandleAsync(request, CancellationToken.None));
}
public static IEnumerable