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
22 changes: 16 additions & 6 deletions TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,18 @@ public override async Task StartContainersForScenarioRun(String scenarioName)

String pataPawaUrlEnvironmentVariable = "OperatorConfiguration:PataPawaPostPay:Url=http://" + this.TestHostContainerName + ":9000/PataPawaPostPayService/basichttp";
String pataPawaApiLogonRequiredEnvironmentVariable = "OperatorConfiguration:PataPawaPostPay:ApiLogonRequired=false";
String transactionProcessorReadModelConnectionString = $"ConnectionStrings:TransactionProcessorReadModel=\"server={this.SqlServerDetails.sqlServerContainerName};user id=sa;password={this.SqlServerDetails.sqlServerPassword};database=TransactionProcessorReadModel\"";

IContainerService transactionProcessorContainer = this.SetupTransactionProcessorContainer("stuartferguson/transactionprocessor",
new List<INetworkService>
{
testNetwork
testNetwork,
Setup.DatabaseServerNetwork
},
true,
additionalEnvironmentVariables:new List<String>
{
transactionProcessorReadModelConnectionString,
pataPawaUrlEnvironmentVariable,
pataPawaApiLogonRequiredEnvironmentVariable,
insecureEventStoreEnvironmentVariable,
Expand Down Expand Up @@ -313,16 +316,23 @@ public override async Task StartContainersForScenarioRun(String scenarioName)
this.HttpClient.BaseAddress = new Uri(TransactionProcessorAclBaseAddressResolver(string.Empty));

await this.LoadEventStoreProjections(this.EventStoreHttpPort, this.IsSecureEventStore).ConfigureAwait(false);
await this.PopulateSubscriptionServiceConfigurationGeneric(this.IsSecureEventStore).ConfigureAwait(false);
}

public async Task PopulateSubscriptionServiceConfiguration(String estateName, Boolean isSecureEventStore)
public async Task PopulateSubscriptionServiceConfigurationForEstate(String estateName, Boolean isSecureEventStore)
{
List<(String streamName, String groupName, Int32 maxRetries)> subscriptions = new List<(String streamName, String groupName, Int32 maxRetries)>();
subscriptions.Add((estateName.Replace(" ", ""), "Reporting", 5));
subscriptions.Add((estateName.Replace(" ", ""), "Reporting", 2));
subscriptions.Add(($"EstateManagementSubscriptionStream_{estateName.Replace(" ", "")}", "Estate Management", 0));
subscriptions.Add(($"TransactionProcessorSubscriptionStream_{estateName.Replace(" ", "")}", "Transaction Processor", 0));
await this.PopulateSubscriptionServiceConfiguration(this.EventStoreHttpPort, subscriptions,
isSecureEventStore);
await this.PopulateSubscriptionServiceConfiguration(this.EventStoreHttpPort, subscriptions, isSecureEventStore);
}
public async Task PopulateSubscriptionServiceConfigurationGeneric(Boolean isSecureEventStore)
{
List<(String streamName, String groupName, Int32 maxRetries)> subscriptions = new List<(String streamName, String groupName, Int32 maxRetries)>();
subscriptions.Add(($"$ce-MerchantBalanceArchive", "Transaction Processor - Ordered", 0));
subscriptions.Add(($"$et-EstateCreatedEvent", "Transaction Processor - Ordered", 2));
await this.PopulateSubscriptionServiceConfiguration(this.EventStoreHttpPort, subscriptions, isSecureEventStore);
}

private async Task RemoveEstateReadModel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Threading;
using System.Threading.Tasks;
using Common;
using DataTransferObjects;
using EstateManagement.DataTransferObjects;
using EstateManagement.DataTransferObjects.Requests;
using EstateManagement.DataTransferObjects.Responses;
Expand Down Expand Up @@ -235,7 +236,7 @@ public async Task GivenIMakeTheFollowingManualMerchantDeposits(Table table)

// Get current balance
MerchantBalanceResponse previousMerchantBalance =
await this.TestingContext.DockerHelper.EstateClient.GetMerchantBalance(token, estateDetails.EstateId, merchantId, CancellationToken.None);
await this.TestingContext.DockerHelper.TransactionProcessorClient.GetMerchantBalance(token, estateDetails.EstateId, merchantId, CancellationToken.None);

MakeMerchantDepositRequest makeMerchantDepositRequest = new MakeMerchantDepositRequest
{
Expand Down Expand Up @@ -264,7 +265,7 @@ public async Task GivenIMakeTheFollowingManualMerchantDeposits(Table table)
await Retry.For(async () =>
{
MerchantBalanceResponse currentMerchantBalance =
await this.TestingContext.DockerHelper.EstateClient.GetMerchantBalance(token,
await this.TestingContext.DockerHelper.TransactionProcessorClient.GetMerchantBalance(token,
estateDetails.EstateId,
merchantId,
CancellationToken.None);
Expand Down Expand Up @@ -574,7 +575,7 @@ public async Task WhenICreateTheFollowingEstates(Table table)
// Setup the subscriptions for the estate
await Retry.For(async () =>
{
await this.TestingContext.DockerHelper.PopulateSubscriptionServiceConfiguration(estateName,this.TestingContext.DockerHelper.IsSecureEventStore).ConfigureAwait(false);
await this.TestingContext.DockerHelper.PopulateSubscriptionServiceConfigurationForEstate(estateName,this.TestingContext.DockerHelper.IsSecureEventStore).ConfigureAwait(false);
}, retryFor: TimeSpan.FromMinutes(2), retryInterval: TimeSpan.FromSeconds(30));

EstateResponse estate = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClientProxyBase" Version="1.3.8" />
<PackageReference Include="ClientProxyBase" Version="1.3.9" />
<PackageReference Include="Ductus.FluentDocker" Version="2.10.51" />
<PackageReference Include="EstateManagement.Client" Version="1.1.3" />
<PackageReference Include="EstateManagement.Client" Version="1.1.5" />
<PackageReference Include="EstateReporting.Database" Version="1.1.7" />
<PackageReference Include="EventStoreProjections" Version="1.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="SecurityService.Client" Version="1.1.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="1.3.8" />
<PackageReference Include="SecurityService.Client" Version="1.1.2-build20" />
<PackageReference Include="Shared.IntegrationTesting" Version="1.3.9" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="SpecFlow" Version="3.9.74" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.9.74" />
<PackageReference Include="SpecFlow.xUnit" Version="3.9.74" />
<PackageReference Include="TransactionProcessor.Client" Version="1.1.9" />
<PackageReference Include="TransactionProcessor.Client" Version="1.1.13-build21" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
Expand Down