Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do

this.HttpClient = new HttpClient();
this.HttpClient.BaseAddress = new Uri(TransactionProcessorAclBaseAddressResolver(string.Empty));
this.HttpClient.Timeout = TimeSpan.FromMinutes(5);

this.ProjectionManagementClient = new EventStoreProjectionManagementClient(ConfigureEventStoreSettings());

Expand Down
72 changes: 39 additions & 33 deletions TransactionProcessorACL.IntegrationTests/Shared/ACLSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,24 @@ public async Task WhenIGetTheMerchantDailyPerformanceSummaryForMerchantForEstate
};


StringContent content = new StringContent(StringSerialiser.Serialise(request), Encoding.UTF8, "application/json");
await Retry.For(async () => {
StringContent content = new(StringSerialiser.Serialise(request), Encoding.UTF8, "application/json");

HttpResponseMessage response = await this.HttpClient.PostAsync(uri, content, cancellationToken).ConfigureAwait(false);
HttpResponseMessage response = await this.HttpClient.PostAsync(uri, content, cancellationToken).ConfigureAwait(false);
String responseContent = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

response.IsSuccessStatusCode.ShouldBeTrue();
response.IsSuccessStatusCode.ShouldBeTrue($"Daily performance summary request failed with {(Int32)response.StatusCode} {response.ReasonPhrase}. Body: {responseContent}");
Comment thread
StuartFerguson marked this conversation as resolved.
Resolved

String responseContent = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
responseContent.ShouldNotBeNullOrEmpty("No response message received");
responseContent.ShouldNotBeNullOrEmpty("No response message received");
Comment thread
StuartFerguson marked this conversation as resolved.
Resolved

ReportingDailyPerformanceSummaryResponse dailyPerformanceSummaryResponse =
StringSerialiser.Deserialise<ReportingDailyPerformanceSummaryResponse>(responseContent,
new SerialiserOptions(SerialiserPropertyFormat.SnakeCase));
ReportingDailyPerformanceSummaryResponse dailyPerformanceSummaryResponse =
StringSerialiser.Deserialise<ReportingDailyPerformanceSummaryResponse>(responseContent,
new SerialiserOptions(SerialiserPropertyFormat.SnakeCase));

es1.AddMerchantDailyPerformanceSummaryResponse(merchantId, dailyPerformanceSummaryResponse);
this.LastMerchantDailyPerformanceSummaryEstateDetails = es1;
this.LastMerchantDailyPerformanceSummaryMerchantId = merchantId;
es1.AddMerchantDailyPerformanceSummaryResponse(merchantId, dailyPerformanceSummaryResponse);
this.LastMerchantDailyPerformanceSummaryEstateDetails = es1;
this.LastMerchantDailyPerformanceSummaryMerchantId = merchantId;
}, TimeSpan.FromMinutes(5), TimeSpan.FromSeconds(5));
}

public void ThenTheMerchantDailyPerformanceSummaryResponseShouldContainAtLeastOneMetricAndTheSaleAmount(Decimal saleAmount)
Expand Down Expand Up @@ -320,22 +322,24 @@ public async Task WhenIGetTheMerchantTransactionMixSummaryForMerchantForEstate(S
TopN = 5,
};

StringContent content = new StringContent(StringSerialiser.Serialise(request), Encoding.UTF8, "application/json");
await Retry.For(async () => {
StringContent content = new(StringSerialiser.Serialise(request), Encoding.UTF8, "application/json");

HttpResponseMessage response = await this.HttpClient.PostAsync(uri, content, cancellationToken).ConfigureAwait(false);
HttpResponseMessage response = await this.HttpClient.PostAsync(uri, content, cancellationToken).ConfigureAwait(false);
String responseContent = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

response.IsSuccessStatusCode.ShouldBeTrue();
response.IsSuccessStatusCode.ShouldBeTrue($"Transaction mix summary request failed with {(Int32)response.StatusCode} {response.ReasonPhrase}. Body: {responseContent}");

String responseContent = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
responseContent.ShouldNotBeNullOrEmpty("No response message received");
responseContent.ShouldNotBeNullOrEmpty("No response message received");

ReportingMerchantTransactionMixSummaryResponse transactionMixSummaryResponse =
StringSerialiser.Deserialise<ReportingMerchantTransactionMixSummaryResponse>(responseContent,
new SerialiserOptions(SerialiserPropertyFormat.SnakeCase));
ReportingMerchantTransactionMixSummaryResponse transactionMixSummaryResponse =
StringSerialiser.Deserialise<ReportingMerchantTransactionMixSummaryResponse>(responseContent,
new SerialiserOptions(SerialiserPropertyFormat.SnakeCase));

es1.AddMerchantTransactionMixSummaryResponse(merchantId, transactionMixSummaryResponse);
this.LastMerchantTransactionMixSummaryEstateDetails = es1;
this.LastMerchantTransactionMixSummaryMerchantId = merchantId;
es1.AddMerchantTransactionMixSummaryResponse(merchantId, transactionMixSummaryResponse);
this.LastMerchantTransactionMixSummaryEstateDetails = es1;
this.LastMerchantTransactionMixSummaryMerchantId = merchantId;
}, TimeSpan.FromMinutes(5), TimeSpan.FromSeconds(5));
}

public async Task WhenIGetTheRecentActivityReceiptSearchForMerchantForEstate(String estateName,
Expand Down Expand Up @@ -364,22 +368,24 @@ public async Task WhenIGetTheRecentActivityReceiptSearchForMerchantForEstate(Str
PageSize = pageSize
};

StringContent content = new StringContent(StringSerialiser.Serialise(request), Encoding.UTF8, "application/json");
await Retry.For(async () => {
StringContent content = new(StringSerialiser.Serialise(request), Encoding.UTF8, "application/json");

HttpResponseMessage response = await this.HttpClient.PostAsync(uri, content, cancellationToken).ConfigureAwait(false);
HttpResponseMessage response = await this.HttpClient.PostAsync(uri, content, cancellationToken).ConfigureAwait(false);
String responseContent = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

response.IsSuccessStatusCode.ShouldBeTrue();
response.IsSuccessStatusCode.ShouldBeTrue($"Recent activity receipt search request failed with {(Int32)response.StatusCode} {response.ReasonPhrase}. Body: {responseContent}");

String responseContent = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
responseContent.ShouldNotBeNullOrEmpty("No response message received");
responseContent.ShouldNotBeNullOrEmpty("No response message received");

RecentActivityReceiptSearchResponse searchResponse =
StringSerialiser.Deserialise<RecentActivityReceiptSearchResponse>(responseContent,
new SerialiserOptions(SerialiserPropertyFormat.SnakeCase));
RecentActivityReceiptSearchResponse searchResponse =
StringSerialiser.Deserialise<RecentActivityReceiptSearchResponse>(responseContent,
new SerialiserOptions(SerialiserPropertyFormat.SnakeCase));

this.RecentActivityReceiptSearchResponses[pageNumber] = searchResponse;
this.LastRecentActivityReceiptSearchEstateDetails = es1;
this.LastRecentActivityReceiptSearchMerchantId = merchantId;
this.RecentActivityReceiptSearchResponses[pageNumber] = searchResponse;
this.LastRecentActivityReceiptSearchEstateDetails = es1;
this.LastRecentActivityReceiptSearchMerchantId = merchantId;
}, TimeSpan.FromMinutes(5), TimeSpan.FromSeconds(5));
}

public void ThenTheMerchantTransactionMixSummaryResponseShouldContainAtLeastOneItemAndTheSaleAmount(Decimal saleAmount)
Expand Down
Loading