Skip to content

Commit

Permalink
VIH-11042 map endpoint conference role for endpoint update (#274)
Browse files Browse the repository at this point in the history
* DTO needs a public setter for the mapper to work

* avoid use of literal strings

(cherry picked from commit 31595ab)
  • Loading branch information
shaed-parkar authored and Shaed Parkar committed Oct 21, 2024
1 parent 1c2c053 commit 698246f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ public class EndpointUpdatedIntegrationEvent : IIntegrationEvent
public string Sip { get; set; }
public string DisplayName { get; set; }
public string DefenceAdvocate { get; set; }
public ConferenceRole Role { get; }
public ConferenceRole Role { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -793,5 +793,29 @@ public async Task Should_send_multiday_confirmation_notifications_for_existing_p

_notificationApiClient.NotificationRequests.Should().HaveCount(1);
}

[Test]
public async Task should_handle_EndpointUpdatedIntegrationEvent()
{
const string message = @"
{
'$type': 'BookingsApi.Infrastructure.Services.IntegrationEvents.EventMessage, BookingsApi.Infrastructure.Services',
'id': '20579099-f03b-4ace-adf5-fb6d4ce5760f',
'timestamp': '2024-10-18T13:38:05.886327Z',
'integration_event': {
'$type': 'BookingsApi.Infrastructure.Services.IntegrationEvents.Events.EndpointUpdatedIntegrationEvent, BookingsApi.Infrastructure.Services',
'hearing_id': 'fb1ab55d-80ce-4700-91a3-8136e3a844d6',
'sip': '[email protected]',
'display_name': 'Endpoint 1',
'defence_advocate': null,
'role': 'host'
}
}
";

await _sut.Run(message);
_videoApiService.UpdateEndpointInConferenceCount.Should().Be(1);

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Extensions.Logging;
using VideoApi.Contract.Responses;
using BookingQueueSubscriber.Services.MessageHandlers.Dtos;
using ConferenceRole = VideoApi.Contract.Enums.ConferenceRole;

namespace BookingQueueSubscriber.UnitTests.MessageHandlers
{
Expand All @@ -27,7 +28,8 @@ public class EndpointUpdatedHandlerTests : MessageHandlerTestBase
DisplayName = integrationEvent.DisplayName,
DefenceAdvocate = integrationEvent.DefenceAdvocate,
Pin = "Pin",
CurrentRoom = new RoomResponse { Id = 1, Label = "Room Label", Locked = false }
CurrentRoom = new RoomResponse { Id = 1, Label = "Room Label", Locked = false },
ConferenceRole = ConferenceRole.Host
}
};

Expand Down
6 changes: 6 additions & 0 deletions BookingQueueSubscriber/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "6.0.100",
"rollForward": "latestFeature"
}
}

0 comments on commit 698246f

Please sign in to comment.