Skip to content

Commit 097a196

Browse files
committed
Fix #56 include files in export request message
Signed-off-by: Victor Chang <[email protected]>
1 parent 3bcfb00 commit 097a196

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/InformaticsGateway/Services/Connectors/PayloadNotificationService.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,19 @@ private async Task<PayloadAction> UpdatePayloadState(Payload payload)
275275
private Task NotifyPayloadReady(Payload payload)
276276
{
277277
_logger.Log(LogLevel.Debug, $"Generating workflow request message for payload {payload.Id}...");
278+
var workflowRequest = new WorkflowRequestMessage
279+
{
280+
PayloadId = payload.Id,
281+
Workflows = payload.Workflows,
282+
FileCount = payload.Count,
283+
CorrelationId = payload.CorrelationId,
284+
Timestamp = payload.DateTimeCreated
285+
};
286+
287+
workflowRequest.Payload.AddRange(payload.UploadedFiles);
288+
278289
var message = new JsonMessage<WorkflowRequestMessage>(
279-
new WorkflowRequestMessage
280-
{
281-
PayloadId = payload.Id,
282-
Workflows = payload.Workflows,
283-
FileCount = payload.Count,
284-
CorrelationId = payload.CorrelationId,
285-
Timestamp = payload.DateTimeCreated
286-
},
290+
workflowRequest,
287291
payload.CorrelationId,
288292
string.Empty);
289293

src/InformaticsGateway/Test/Services/Connectors/PayloadNotificationServiceTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ public void PayloadNotificationService_ShalUploadFilesAndPublish()
296296
_storageService.Verify(p => p.PutObject(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Stream>(), It.IsAny<long>(), It.IsAny<string>(), It.IsAny<Dictionary<string, string>>(), It.IsAny<CancellationToken>()), Times.Exactly(2));
297297

298298
_instanceCleanupQueue.Verify(p => p.Queue(It.IsAny<FileStorageInfo>()), Times.Once());
299+
300+
_messageBrokerPublisherService.Verify(p => p.Publish(It.Is<string>(p => p.Equals(_options.Value.Messaging.Topics.WorkflowRequest)), It.Is<Message>(p => p.ConvertTo<WorkflowRequestMessage>().Payload.Count == 1)), Times.Once());
299301
}
300302
}
301303
}

0 commit comments

Comments
 (0)