1
0
mirror of https://github.com/bitwarden/server synced 2025-12-25 12:43:14 +00:00

Merge branch 'km/pm-10564' into km/pm-15084

# Conflicts:
#	src/Core/Models/PushNotification.cs
#	src/Core/NotificationHub/NotificationHubPushNotificationService.cs
#	src/Core/Services/Implementations/AzureQueuePushNotificationService.cs
#	src/Core/Services/Implementations/NotificationsApiPushNotificationService.cs
#	src/Core/Services/Implementations/RelayPushNotificationService.cs
#	src/Core/Services/NoopImplementations/NoopPushNotificationService.cs
#	test/Core.Test/NotificationHub/NotificationHubPushNotificationServiceTests.cs
#	test/Core.Test/Services/AzureQueuePushNotificationServiceTests.cs
This commit is contained in:
Maciej Zieniuk
2024-11-26 18:44:54 +00:00
25 changed files with 409 additions and 307 deletions

View File

@@ -33,7 +33,7 @@ public class PushControllerTests
var exception = await Assert.ThrowsAsync<BadRequestException>(() =>
sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotificationCreate,
Type = PushType.SyncNotification,
UserId = userId.ToString(),
OrganizationId = organizationId.ToString(),
InstallationId = installationId.ToString(),
@@ -63,7 +63,7 @@ public class PushControllerTests
await sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotificationCreate,
Type = PushType.SyncNotification,
UserId = null,
OrganizationId = null,
InstallationId = null,
@@ -96,7 +96,7 @@ public class PushControllerTests
await sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotificationCreate,
Type = PushType.SyncNotification,
UserId = userId.ToString(),
OrganizationId = haveOrganizationId ? Guid.NewGuid().ToString() : null,
InstallationId = null,
@@ -107,7 +107,7 @@ public class PushControllerTests
});
await sutProvider.GetDependency<IPushNotificationService>().Received(1)
.SendPayloadToUserAsync(expectedUserId, PushType.SyncNotificationCreate, "test-payload", expectedIdentifier,
.SendPayloadToUserAsync(expectedUserId, PushType.SyncNotification, "test-payload", expectedIdentifier,
expectedDeviceId, ClientType.All);
await sutProvider.GetDependency<IPushNotificationService>().Received(0)
.SendPayloadToOrganizationAsync(Arg.Any<string>(), Arg.Any<PushType>(), Arg.Any<object>(),
@@ -132,7 +132,7 @@ public class PushControllerTests
await sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotificationCreate,
Type = PushType.SyncNotification,
UserId = null,
OrganizationId = organizationId.ToString(),
InstallationId = null,
@@ -143,7 +143,7 @@ public class PushControllerTests
});
await sutProvider.GetDependency<IPushNotificationService>().Received(1)
.SendPayloadToOrganizationAsync(expectedOrganizationId, PushType.SyncNotificationCreate, "test-payload",
.SendPayloadToOrganizationAsync(expectedOrganizationId, PushType.SyncNotification, "test-payload",
expectedIdentifier, expectedDeviceId, ClientType.All);
await sutProvider.GetDependency<IPushNotificationService>().Received(0)
.SendPayloadToUserAsync(Arg.Any<string>(), Arg.Any<PushType>(), Arg.Any<object>(), Arg.Any<string>(),
@@ -166,7 +166,7 @@ public class PushControllerTests
await sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotificationCreate,
Type = PushType.SyncNotification,
UserId = null,
OrganizationId = null,
InstallationId = installationId.ToString(),
@@ -177,7 +177,7 @@ public class PushControllerTests
});
await sutProvider.GetDependency<IPushNotificationService>().Received(1)
.SendPayloadToInstallationAsync(installationId.ToString(), PushType.SyncNotificationCreate, "test-payload",
.SendPayloadToInstallationAsync(installationId.ToString(), PushType.SyncNotification, "test-payload",
expectedIdentifier, expectedDeviceId, ClientType.All);
await sutProvider.GetDependency<IPushNotificationService>().Received(0)
.SendPayloadToOrganizationAsync(Arg.Any<string>(), Arg.Any<PushType>(), Arg.Any<object>(),
@@ -198,7 +198,7 @@ public class PushControllerTests
var exception = await Assert.ThrowsAsync<BadRequestException>(() =>
sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotificationCreate,
Type = PushType.SyncNotification,
UserId = null,
OrganizationId = null,
InstallationId = Guid.NewGuid().ToString(),