Skip to content

Commit 2b23d0e

Browse files
Merge pull request #80 from TransactionProcessing/nightlybuild/#74_investigatefailure
Added call to get file to determine if file has been processed after …
2 parents 92976e5 + 6fe8066 commit 2b23d0e

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

FileProcessor.IntegrationTests/Features/SharedSteps.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace FileProcessor.IntegrationTests.Features
1313
using System.Threading;
1414
using Common;
1515
using DataTransferObjects;
16+
using DataTransferObjects.Responses;
1617
using Newtonsoft.Json;
1718
using Shared.IntegrationTesting;
1819
using Shouldly;
@@ -45,7 +46,20 @@ public async Task GivenIUploadThisFileForProcessing(Table table)
4546
{
4647
var fileId = await this.UploadFile(table);
4748

49+
var estate = this.TestingContext.GetEstateDetails(table.Rows.First());
50+
Guid estateId = estate.EstateId;
51+
4852
fileId.ShouldNotBe(Guid.Empty);
53+
estateId.ShouldNotBe(Guid.Empty);
54+
55+
await Retry.For(async () =>
56+
{
57+
FileDetails fileDetails =
58+
await this.TestingContext.DockerHelper.FileProcessorClient.GetFile(this.TestingContext.AccessToken, estate.EstateId, fileId, CancellationToken.None);
59+
60+
fileDetails.ShouldNotBeNull();
61+
fileDetails.ProcessingCompleted.ShouldBeTrue();
62+
}, TimeSpan.FromMinutes(3));
4963
}
5064

5165
[Given(@"I upload this file for processing an error should be returned indicating the file is a duplicate")]
@@ -89,10 +103,7 @@ private async Task<Guid> UploadFile(Table table)
89103
fileData,
90104
uploadFileRequest,
91105
CancellationToken.None);
92-
93-
// Now we need to wait some time to let the file be processed
94-
await Task.Delay(TimeSpan.FromMinutes(1));
95-
106+
96107
return fileId;
97108
}
98109

0 commit comments

Comments
 (0)