diff --git a/src/Spotflow.InMemory.Azure.ServiceBus/Internals/MessagesStore.cs b/src/Spotflow.InMemory.Azure.ServiceBus/Internals/MessagesStore.cs index 1f73f05..4e170bc 100644 --- a/src/Spotflow.InMemory.Azure.ServiceBus/Internals/MessagesStore.cs +++ b/src/Spotflow.InMemory.Azure.ServiceBus/Internals/MessagesStore.cs @@ -232,23 +232,23 @@ private ServiceBusReceivedMessage FinishReceiveMessageUnsafe(EnqueuedServiceBusM throw new InvalidOperationException($"Unsupported receive mode: {receiveMode}."); } - - return ServiceBusModelFactory.ServiceBusReceivedMessage( body: message.Body, messageId: message.MessageId, sessionId: message.SessionId, replyToSessionId: message.ReplyToSessionId, + replyTo: message.ReplyTo, timeToLive: message.TimeToLive, correlationId: message.CorrelationId, contentType: message.ContentType, enqueuedTime: timeProvider.GetUtcNow(), properties: message.ApplicationProperties, + subject: message.Subject, lockTokenGuid: lockToken, lockedUntil: lockedUntil, - sequenceNumber: sequenceNumber + sequenceNumber: sequenceNumber, + partitionKey: message.PartitionKey ); - } private void ReleaseExpiredMessagesUnsafe() diff --git a/tests/Tests/ServiceBus/ServiceBusReceiverTests.cs b/tests/Tests/ServiceBus/ServiceBusReceiverTests.cs index 80316c9..7536575 100644 --- a/tests/Tests/ServiceBus/ServiceBusReceiverTests.cs +++ b/tests/Tests/ServiceBus/ServiceBusReceiverTests.cs @@ -303,12 +303,12 @@ public async Task Received_Message_Should_Have_All_Expected_Properties() receivedMessage.ApplicationProperties.Count.Should().Be(1); receivedMessage.ApplicationProperties["test-app-property"].Should().Be("test-app-property-value"); - //receivedMessage.Subject.Should().Be("test-subject"); + receivedMessage.Subject.Should().Be("test-subject"); receivedMessage.ContentType.Should().Be("test-content-type"); receivedMessage.CorrelationId.Should().Be("test-correlation-id"); receivedMessage.MessageId.Should().Be("test-message-id"); - //receivedMessage.PartitionKey.Should().Be("test-partition-key"); - //receivedMessage.ReplyTo.Should().Be("test-reply-to"); + receivedMessage.PartitionKey.Should().Be("test-partition-key"); + receivedMessage.ReplyTo.Should().Be("test-reply-to"); receivedMessage.ReplyToSessionId.Should().Be("test-reply-to-session-id"); receivedMessage.EnqueuedTime.Should().Be(timeProvider.GetUtcNow());