From 4815e54799dad47472b9c7147165143747f89088 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Fri, 9 Oct 2026 09:40:30 +0100 Subject: [PATCH 1/6] night build failure fixess --- Directory.Packages.props | 20 +++++++++---------- .../Common/DockerHelper.cs | 20 ++++++++++++++++++- .../Shared/SharedSteps.cs | 2 +- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 48658fa..33897fc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,9 +5,9 @@ - + - + @@ -16,7 +16,7 @@ - + @@ -38,11 +38,11 @@ - - - - - + + + + + @@ -50,8 +50,8 @@ - - + + diff --git a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs index d4306dd..18def49 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs @@ -77,6 +77,16 @@ public override DotNet.Testcontainers.Builders.ContainerBuilder SetupEstateRepor return base.SetupEstateReportingContainer(); } + //public override ContainerBuilder SetupSecurityServiceContainer() + //{ + // Dictionary additionalVariables = new(); + // additionalVariables.Add("ServiceOptions:OAuth:LegacyGrantTypeClients:password:1", "estateClient"); + + // this.AdditionalVariables.Add(ContainerType.SecurityService, additionalVariables); + + // return base.SetupSecurityServiceContainer(); + //} + public override ContainerBuilder SetupTransactionProcessorContainer() { Dictionary additionalVariables = new(); @@ -145,9 +155,17 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do this.HttpClient.Timeout = TimeSpan.FromMinutes(5); this.ProjectionManagementClient = new EventStoreProjectionManagementClient(ConfigureEventStoreSettings()); - + + SimpleResults.Result bootstrapToken = await this.SecurityServiceClient.GetToken("management-bootstrap", "management-bootstrap-secret", CancellationToken.None); + if (bootstrapToken.IsFailed || String.IsNullOrWhiteSpace(bootstrapToken.Data?.AccessToken)) + { + throw new InvalidOperationException("Unable to obtain the integration-test management bootstrap token."); + } + this.AccessToken = bootstrapToken.Data.AccessToken; } + public String AccessToken; + private void DumpDockerContainerState() { ProcessStartInfo startInfo = new ProcessStartInfo diff --git a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs index 50b9dc8..3ff4025 100644 --- a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs @@ -63,7 +63,7 @@ public SharedSteps(ScenarioContext scenarioContext, TestingContext testingContext){ this.ScenarioContext = scenarioContext; this.TestingContext = testingContext; - this.SecurityServiceSteps = new SecurityServiceSteps(testingContext.DockerHelper.SecurityServiceClient); + this.SecurityServiceSteps = new SecurityServiceSteps(testingContext.DockerHelper.SecurityServiceClient, testingContext.DockerHelper.AccessToken); this.TransactionProcessorSteps = new TransactionProcessorSteps(testingContext.DockerHelper.TransactionProcessorClient, testingContext.DockerHelper.TestHostHttpClient, testingContext.DockerHelper.ProjectionManagementClient, testingContext.DockerHelper.AgencyBankingClient); this.AclSteps = new ACLSteps(testingContext.DockerHelper.HttpClient, this.TestingContext.DockerHelper.TransactionProcessorClient); From da37f74b3524bedd33a2f5b45e853702d78519fa Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Fri, 9 Oct 2026 19:15:08 +0100 Subject: [PATCH 2/6] :| --- Directory.Packages.props | 4 ++-- .../Common/DockerHelper.cs | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 33897fc..93018d7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -50,8 +50,8 @@ - - + + diff --git a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs index 18def49..16e6d75 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs @@ -232,6 +232,17 @@ public override Dictionary GetAdditionalVariables(ContainerType return additionalVariables; } + public override ContainerBuilder SetupSecurityServiceContainer() + { + Dictionary additionalVariables = new(); + additionalVariables.Add("ServiceOptions:OAuth:LegacyGrantTypeClients:password:1", "estateClient"); + additionalVariables.Add("ServiceOptions:UserOptions:UseProvidedPasswordForEmailUsers", "true"); + + this.AdditionalVariables.Add(ContainerType.SecurityService, additionalVariables); + + return base.SetupSecurityServiceContainer(); + } + #endregion } From 070efec454fd717302aa012de42101123562c86d Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Sat, 10 Oct 2026 10:13:53 +0100 Subject: [PATCH 3/6] test: configure integration test hosts --- .../AssemblyInfo.cs | 2 +- .../Merchants/Merchants.feature | 16 ++ .../Merchants/Merchants.feature.cs | 238 ++++++++++-------- .../Reporting/Reporting.feature | 2 +- .../Reporting/Reporting.feature.cs | 214 ++++++++-------- 5 files changed, 264 insertions(+), 208 deletions(-) diff --git a/TransactionProcessorACL.IntegrationTests/AssemblyInfo.cs b/TransactionProcessorACL.IntegrationTests/AssemblyInfo.cs index 2bf6799..24d036a 100644 --- a/TransactionProcessorACL.IntegrationTests/AssemblyInfo.cs +++ b/TransactionProcessorACL.IntegrationTests/AssemblyInfo.cs @@ -16,5 +16,5 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM. [assembly: Guid("25d4d6fc-b809-4acc-a910-249a03e5f07a")] -[assembly: LevelOfParallelism(3)] +[assembly: LevelOfParallelism(1)] [assembly: Parallelizable(ParallelScope.Fixtures)] diff --git a/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature b/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature index d03a792..0148e67 100644 --- a/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature +++ b/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature @@ -26,6 +26,22 @@ Background: | ClientId | | serviceClient | + Given the following bills are available at the PataPawa PostPaid Host + | AccountNumber | AccountName | DueDate | Amount | + | 12345678 | Test Account 1 | Today | 100.00 | + + Given the following users are available at the PataPawa PrePay Host + | Username | Password | + | operatora | 1234567898 | + + Given the following meters are available at the PataPawa PrePay Host + | MeterNumber | CustomerName | + | 00000001 | Customer 1 | + | 00000002 | Customer 2 | + | 00000003 | Customer 3 | + + Given I initialise the Agency Banking Host + Given I have created the following estates | EstateName | | Test Estate 1 | diff --git a/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature.cs b/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature.cs index 937bf73..7621a53 100644 --- a/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature.cs +++ b/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature.cs @@ -111,134 +111,174 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table1 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table16.AddRow(new string[] { + table1.AddRow(new string[] { "Merchant"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table16, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table1, "Given "); #line hidden - global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table2 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table17.AddRow(new string[] { + table2.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table17.AddRow(new string[] { + table2.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST Scope", "A scope for Transaction Processor ACL REST"}); #line 10 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table17, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table2, "Given "); #line hidden - global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table3 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table18.AddRow(new string[] { + table3.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); - table18.AddRow(new string[] { + table3.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST", "Secret1", "transactionProcessorACL", "merchantId, estateId, role"}); #line 15 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table18, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table3, "Given "); #line hidden - global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table4 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table19.AddRow(new string[] { + table4.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor,transactionProcessorACL", "client_credentials"}); - table19.AddRow(new string[] { + table4.AddRow(new string[] { "merchantClient", "Merchant Client", "Secret1", "transactionProcessorACL", "password"}); #line 20 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table19, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table4, "Given "); #line hidden - global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table5 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table20.AddRow(new string[] { + table5.AddRow(new string[] { "serviceClient"}); #line 25 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor acl reso" + - "urces", ((string)(null)), table20, "Given "); + "urces", ((string)(null)), table5, "Given "); +#line hidden + global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { + "AccountNumber", + "AccountName", + "DueDate", + "Amount"}); + table6.AddRow(new string[] { + "12345678", + "Test Account 1", + "Today", + "100.00"}); +#line 29 + await testRunner.GivenAsync("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table6, "Given "); +#line hidden + global::Reqnroll.Table table7 = new global::Reqnroll.Table(new string[] { + "Username", + "Password"}); + table7.AddRow(new string[] { + "operatora", + "1234567898"}); +#line 33 + await testRunner.GivenAsync("the following users are available at the PataPawa PrePay Host", ((string)(null)), table7, "Given "); #line hidden - global::Reqnroll.Table table21 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table8 = new global::Reqnroll.Table(new string[] { + "MeterNumber", + "CustomerName"}); + table8.AddRow(new string[] { + "00000001", + "Customer 1"}); + table8.AddRow(new string[] { + "00000002", + "Customer 2"}); + table8.AddRow(new string[] { + "00000003", + "Customer 3"}); +#line 37 + await testRunner.GivenAsync("the following meters are available at the PataPawa PrePay Host", ((string)(null)), table8, "Given "); +#line hidden +#line 43 + await testRunner.GivenAsync("I initialise the Agency Banking Host", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); +#line hidden + global::Reqnroll.Table table9 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table21.AddRow(new string[] { + table9.AddRow(new string[] { "Test Estate 1"}); - table21.AddRow(new string[] { + table9.AddRow(new string[] { "Test Estate 2"}); -#line 29 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table21, "Given "); +#line 45 + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table9, "Given "); #line hidden - global::Reqnroll.Table table22 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table10 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table22.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table22.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); - table22.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 2", "Safaricom", "True", "True"}); - table22.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 2", "Voucher", "True", "True"}); -#line 34 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table22, "Given "); +#line 50 + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table10, "Given "); #line hidden - global::Reqnroll.Table table23 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table11 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table23.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table23.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 1", "Voucher"}); - table23.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 2", "Safaricom"}); - table23.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 2", "Voucher"}); -#line 41 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table23, "And "); +#line 57 + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table11, "And "); #line hidden - global::Reqnroll.Table table24 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table12 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -248,7 +288,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table24.AddRow(new string[] { + table12.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -258,7 +298,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table24.AddRow(new string[] { + table12.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -268,7 +308,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table24.AddRow(new string[] { + table12.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -278,109 +318,109 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 3", "testcontact3@merchant2.co.uk", "Test Estate 2"}); -#line 48 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table24, "Given "); +#line 64 + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table12, "Given "); #line hidden - global::Reqnroll.Table table25 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table13 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table25.AddRow(new string[] { + table13.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table25.AddRow(new string[] { + table13.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table25.AddRow(new string[] { + table13.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table25.AddRow(new string[] { + table13.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table25.AddRow(new string[] { + table13.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); - table25.AddRow(new string[] { + table13.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); -#line 54 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table25, "Given "); +#line 70 + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table13, "Given "); #line hidden - global::Reqnroll.Table table26 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table14 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName", "MerchantName"}); - table26.AddRow(new string[] { + table14.AddRow(new string[] { "merchantuser@testmerchant1.co.uk", "123456", "TestMerchant", "User1", "Test Estate 1", "Test Merchant 1"}); - table26.AddRow(new string[] { + table14.AddRow(new string[] { "merchantuser@testmerchant2.co.uk", "123456", "TestMerchant", "User2", "Test Estate 1", "Test Merchant 2"}); - table26.AddRow(new string[] { + table14.AddRow(new string[] { "merchantuser@testmerchant3.co.uk", "123456", "TestMerchant", "User3", "Test Estate 2", "Test Merchant 3"}); -#line 63 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table26, "Given "); +#line 79 + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table14, "Given "); #line hidden - global::Reqnroll.Table table27 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table15 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table27.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table27.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table27.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); - table27.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract"}); -#line 69 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table27, "Given "); +#line 85 + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table15, "Given "); #line hidden - global::Reqnroll.Table table28 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -388,7 +428,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table28.AddRow(new string[] { + table16.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -396,7 +436,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table28.AddRow(new string[] { + table16.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -404,7 +444,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); - table28.AddRow(new string[] { + table16.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -412,7 +452,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table28.AddRow(new string[] { + table16.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract", @@ -420,10 +460,10 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); -#line 76 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table28, "When "); +#line 92 + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table16, "When "); #line hidden - global::Reqnroll.Table table29 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -431,7 +471,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table29.AddRow(new string[] { + table17.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -439,7 +479,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Fixed", "Merchant Commission", "2.50"}); - table29.AddRow(new string[] { + table17.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -447,39 +487,39 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Percentage", "Merchant Commission", "0.85"}); -#line 83 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table29, "When "); +#line 99 + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table17, "When "); #line hidden - global::Reqnroll.Table table30 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table30.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table30.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table30.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table30.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Hospital 1 Contract"}); - table30.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Safaricom Contract"}); - table30.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Hospital 1 Contract"}); -#line 88 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table30, "When "); +#line 104 + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table18, "When "); #line hidden } @@ -498,7 +538,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Get Merchant", null, tagsOfScenario, argumentsOfScenario, featureTags, pickleIndex); string[] tagsOfRule = ((string[])(null)); global::Reqnroll.RuleInfo ruleInfo = null; -#line 98 +#line 114 this.ScenarioInitialize(scenarioInfo, ruleInfo); #line hidden if ((global::Reqnroll.TagHelper.ContainsIgnoreTag(scenarioInfo.CombinedTags) || global::Reqnroll.TagHelper.ContainsIgnoreTag(featureTags))) @@ -511,12 +551,12 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 4 await this.FeatureBackgroundAsync(); #line hidden -#line 99 +#line 115 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant1.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table31 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -524,7 +564,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Country", "ContactName", "EmailAddress"}); - table31.AddRow(new string[] { + table19.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -532,9 +572,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "United Kingdom", "Test Contact 1", "testcontact1@merchant1.co.uk"}); -#line 100 +#line 116 await testRunner.WhenAsync("I get the merchant information for Merchant \"Test Merchant 1\" for Estate \"Test Es" + - "tate 1\" the response should contain the following information", ((string)(null)), table31, "When "); + "tate 1\" the response should contain the following information", ((string)(null)), table19, "When "); #line hidden } await this.ScenarioCleanupAsync(); @@ -550,7 +590,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Get Merchant Contracts", null, tagsOfScenario, argumentsOfScenario, featureTags, pickleIndex); string[] tagsOfRule = ((string[])(null)); global::Reqnroll.RuleInfo ruleInfo = null; -#line 104 +#line 120 this.ScenarioInitialize(scenarioInfo, ruleInfo); #line hidden if ((global::Reqnroll.TagHelper.ContainsIgnoreTag(scenarioInfo.CombinedTags) || global::Reqnroll.TagHelper.ContainsIgnoreTag(featureTags))) @@ -563,23 +603,23 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 4 await this.FeatureBackgroundAsync(); #line hidden -#line 105 +#line 121 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant1.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table32 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { "MerchantName", "ContractDescription"}); - table32.AddRow(new string[] { + table20.AddRow(new string[] { "Test Merchant 1", "Safaricom Contract"}); - table32.AddRow(new string[] { + table20.AddRow(new string[] { "Test Merchant 1", "Hospital 1 Contract"}); -#line 106 +#line 122 await testRunner.WhenAsync("I get the merchant contract information for Merchant \"Test Merchant 1\" for Estate" + - " \"Test Estate 1\" the response should contain the following information", ((string)(null)), table32, "When "); + " \"Test Estate 1\" the response should contain the following information", ((string)(null)), table20, "When "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature index 542e6bf..16612ba 100644 --- a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature +++ b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature @@ -22,7 +22,7 @@ Background: Given the following clients exist | ClientId | ClientName | Secret | Scopes | GrantTypes | | serviceClient | Service Client | Secret1 | transactionProcessor,transactionProcessorACL, estateReporting | client_credentials | - | merchantClient | Merchant Client | Secret1 | transactionProcessorACL | password | + | merchantClient | Merchant Client | Secret1 | transactionProcessorACL, estateReporting | password | Given I have a token to access the estate management and transaction processor acl resources | ClientId | diff --git a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs index 911167e..13b68a5 100644 --- a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs +++ b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs @@ -113,167 +113,167 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table73 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table1 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table73.AddRow(new string[] { + table1.AddRow(new string[] { "Merchant"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table73, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table1, "Given "); #line hidden - global::Reqnroll.Table table74 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table2 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table74.AddRow(new string[] { + table2.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table74.AddRow(new string[] { + table2.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST Scope", "A scope for Transaction Processor ACL REST"}); - table74.AddRow(new string[] { + table2.AddRow(new string[] { "estateReporting", "Estate Reporting REST Scope", "Scope for Estate Reporting REST"}); #line 10 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table74, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table2, "Given "); #line hidden - global::Reqnroll.Table table75 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table3 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table75.AddRow(new string[] { + table3.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); - table75.AddRow(new string[] { + table3.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST", "Secret1", "transactionProcessorACL", "merchantId, estateId, role"}); - table75.AddRow(new string[] { + table3.AddRow(new string[] { "estateReporting", "Estate Reporting REST", "Secret1", "estateReporting", "merchantId,estateId,role"}); #line 16 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table75, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table3, "Given "); #line hidden - global::Reqnroll.Table table76 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table4 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table76.AddRow(new string[] { + table4.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor,transactionProcessorACL, estateReporting", "client_credentials"}); - table76.AddRow(new string[] { + table4.AddRow(new string[] { "merchantClient", "Merchant Client", "Secret1", - "transactionProcessorACL", + "transactionProcessorACL, estateReporting", "password"}); #line 22 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table76, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table4, "Given "); #line hidden - global::Reqnroll.Table table77 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table5 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table77.AddRow(new string[] { + table5.AddRow(new string[] { "serviceClient"}); #line 27 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor acl reso" + - "urces", ((string)(null)), table77, "Given "); + "urces", ((string)(null)), table5, "Given "); #line hidden - global::Reqnroll.Table table78 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table78.AddRow(new string[] { + table6.AddRow(new string[] { "Test Estate 1"}); - table78.AddRow(new string[] { + table6.AddRow(new string[] { "Test Estate 2"}); #line 31 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table78, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table6, "Given "); #line hidden - global::Reqnroll.Table table79 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table7 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table79.AddRow(new string[] { + table7.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table79.AddRow(new string[] { + table7.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); - table79.AddRow(new string[] { + table7.AddRow(new string[] { "Test Estate 2", "Safaricom", "True", "True"}); - table79.AddRow(new string[] { + table7.AddRow(new string[] { "Test Estate 2", "Voucher", "True", "True"}); #line 36 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table79, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table7, "Given "); #line hidden - global::Reqnroll.Table table80 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table8 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table80.AddRow(new string[] { + table8.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table80.AddRow(new string[] { + table8.AddRow(new string[] { "Test Estate 1", "Voucher"}); - table80.AddRow(new string[] { + table8.AddRow(new string[] { "Test Estate 2", "Safaricom"}); - table80.AddRow(new string[] { + table8.AddRow(new string[] { "Test Estate 2", "Voucher"}); #line 43 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table80, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table8, "And "); #line hidden - global::Reqnroll.Table table81 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table9 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table81.AddRow(new string[] { + table9.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table81.AddRow(new string[] { + table9.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table81.AddRow(new string[] { + table9.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); - table81.AddRow(new string[] { + table9.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract"}); #line 50 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table81, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table9, "Given "); #line hidden - global::Reqnroll.Table table82 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table10 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -281,7 +281,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table82.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -289,7 +289,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table82.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -297,7 +297,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); - table82.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -305,7 +305,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table82.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract", @@ -314,9 +314,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Voucher"}); #line 57 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table82, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table10, "When "); #line hidden - global::Reqnroll.Table table83 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table11 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -324,7 +324,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table83.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -332,7 +332,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Fixed", "Merchant Commission", "2.50"}); - table83.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -341,9 +341,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Commission", "0.85"}); #line 64 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table83, "When "); + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table11, "When "); #line hidden - global::Reqnroll.Table table84 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table12 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -353,7 +353,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table84.AddRow(new string[] { + table12.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -363,7 +363,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table84.AddRow(new string[] { + table12.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -373,7 +373,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table84.AddRow(new string[] { + table12.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -384,152 +384,152 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact3@merchant2.co.uk", "Test Estate 2"}); #line 69 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table84, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table12, "Given "); #line hidden - global::Reqnroll.Table table85 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table13 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); #line 75 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table85, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table13, "Given "); #line hidden - global::Reqnroll.Table table86 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table14 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table86.AddRow(new string[] { + table14.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table86.AddRow(new string[] { + table14.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table86.AddRow(new string[] { + table14.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 2"}); #line 84 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table86, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table14, "Given "); #line hidden - global::Reqnroll.Table table87 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table15 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table87.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table87.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table87.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table87.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Hospital 1 Contract"}); - table87.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Safaricom Contract"}); - table87.AddRow(new string[] { + table15.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Hospital 1 Contract"}); #line 90 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table87, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table15, "When "); #line hidden - global::Reqnroll.Table table88 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table88.AddRow(new string[] { + table16.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table88.AddRow(new string[] { + table16.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table88.AddRow(new string[] { + table16.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 3", "Test Estate 2"}); #line 99 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table88, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table16, "Given "); #line hidden - global::Reqnroll.Table table89 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName", "MerchantName"}); - table89.AddRow(new string[] { + table17.AddRow(new string[] { "merchantuser@testmerchant1.co.uk", "123456", "TestMerchant", "User1", "Test Estate 1", "Test Merchant 1"}); - table89.AddRow(new string[] { + table17.AddRow(new string[] { "merchantuser@testmerchant2.co.uk", "123456", "TestMerchant", "User2", "Test Estate 1", "Test Merchant 2"}); - table89.AddRow(new string[] { + table17.AddRow(new string[] { "merchantuser@testmerchant3.co.uk", "123456", "TestMerchant", @@ -537,7 +537,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 2", "Test Merchant 3"}); #line 105 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table89, "Given "); + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table17, "Given "); #line hidden } @@ -576,7 +576,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table90 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -591,7 +591,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ProductName", "RecipientEmail", "RecipientMobile"}); - table90.AddRow(new string[] { + table18.AddRow(new string[] { "Today", "8", "Sale", @@ -607,7 +607,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", ""}); #line 114 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table90, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table18, "When "); #line hidden #line 118 await testRunner.WhenAsync("I get the merchant daily performance summary for Merchant \"Test Merchant 1\" for E" + @@ -651,7 +651,7 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table91 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -666,7 +666,7 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou "ProductName", "RecipientEmail", "RecipientMobile"}); - table91.AddRow(new string[] { + table19.AddRow(new string[] { "Today", "9", "Sale", @@ -682,7 +682,7 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou "", ""}); #line 124 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table91, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table19, "When "); #line hidden #line 128 await testRunner.WhenAsync("I get the merchant transaction mix summary for Merchant \"Test Merchant 1\" for Est" + @@ -726,7 +726,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table92 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -741,7 +741,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "ProductName", "RecipientEmail", "RecipientMobile"}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1001", "Sale", @@ -756,7 +756,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1002", "Sale", @@ -771,7 +771,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1003", "Sale", @@ -786,7 +786,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1004", "Sale", @@ -801,7 +801,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1005", "Sale", @@ -816,7 +816,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1006", "Sale", @@ -831,7 +831,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1007", "Sale", @@ -846,7 +846,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1008", "Sale", @@ -861,7 +861,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1009", "Sale", @@ -876,7 +876,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "Today", "1010", "Sale", @@ -892,7 +892,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "", ""}); #line 134 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table92, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table20, "When "); #line hidden #line 147 await testRunner.WhenAsync("I get the recent activity receipt search for Merchant \"Test Merchant 1\" for Estat" + From 70e7f602498e848a02f501eddd6dc886d1f67d82 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 13 Oct 2026 05:41:10 +0100 Subject: [PATCH 4/6] more changes --- Directory.Packages.props | 16 +- .../Common/AgencyBankingAssertions.cs | 45 ++ .../Common/AgencyBankingAssertionsTests.cs | 30 ++ .../Common/DockerHelper.cs | 12 +- .../Common/GenericSteps.cs | 2 +- .../Common/Retry.cs | 8 +- .../Common/RetryTests.cs | 29 ++ .../Common/TransactionResponseAssertions.cs | 20 + .../TransactionResponseAssertionsTests.cs | 26 ++ .../Merchants/Merchants.feature.cs | 188 ++++----- .../Reconciliation/Reconciliation.feature.cs | 172 ++++---- .../RedeemVoucher/RedeemVoucher.feature.cs | 148 +++---- .../Reporting/Reporting.feature | 2 +- .../Reporting/Reporting.feature.cs | 214 +++++----- .../SalesTransaction.feature.cs | 384 +++++++++--------- .../Shared/ACLSteps.cs | 22 +- .../Shared/SharedSteps.cs | 52 ++- .../Bootstrapper/MiddlewareRegistry.cs | 1 + .../AuthorizationFailureDiagnosticsHandler.cs | 49 +++ TransactionProcessorACL/Startup.cs | 25 ++ 20 files changed, 864 insertions(+), 581 deletions(-) create mode 100644 TransactionProcessorACL.IntegrationTests/Common/AgencyBankingAssertions.cs create mode 100644 TransactionProcessorACL.IntegrationTests/Common/AgencyBankingAssertionsTests.cs create mode 100644 TransactionProcessorACL.IntegrationTests/Common/RetryTests.cs create mode 100644 TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertions.cs create mode 100644 TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertionsTests.cs create mode 100644 TransactionProcessorACL/Middleware/AuthorizationFailureDiagnosticsHandler.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 93018d7..26fd030 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ - + @@ -38,11 +38,11 @@ - - - - - + + + + + @@ -50,8 +50,8 @@ - - + + diff --git a/TransactionProcessorACL.IntegrationTests/Common/AgencyBankingAssertions.cs b/TransactionProcessorACL.IntegrationTests/Common/AgencyBankingAssertions.cs new file mode 100644 index 0000000..4331d4b --- /dev/null +++ b/TransactionProcessorACL.IntegrationTests/Common/AgencyBankingAssertions.cs @@ -0,0 +1,45 @@ +using Shouldly; +using TestHosts.DataTransferObjects.AgencyBanking; + +namespace TransactionProcessor.IntegrationTests.Common; + +public static class AgencyBankingAssertions +{ + public static void VerifyGlAccount(GlAccountResponse response, CreateGlAccountRequest request) + { + response.ShouldNotBeNull(); + response.GlCode.ShouldBe(request.GlCode); + response.GlName.ShouldBe(request.GlName); + response.GlType.ShouldBe(request.GlType); + response.Currency.ShouldBe(request.Currency); + } + + public static void VerifyCustomer(CustomerResponse response, CreateCustomerRequest request) + { + response.ShouldNotBeNull(); + response.CustomerId.ShouldBe(request.CustomerId); + response.FullName.ShouldBe(request.FullName); + response.PhoneNumber.ShouldBe(request.PhoneNumber); + response.NationalId.ShouldBe(request.NationalId); + response.AccountNumber.ShouldBe(request.AccountNumber); + } + + public static void VerifySettlementAccount(SettlementAccountResponse response, CreateSettlementAccountRequest request) + { + response.ShouldNotBeNull(); + response.AccountNumber.ShouldBe(request.AccountNumber); + response.AccountName.ShouldBe(request.AccountName); + response.BankCode.ShouldBe(request.BankCode); + response.Currency.ShouldBe(request.Currency); + } + + public static void VerifySystemConfiguration(SystemConfigurationDto response, SystemInitializationRequest request) + { + response.ShouldNotBeNull(); + response.InstitutionCode.ShouldBe(request.InstitutionCode); + response.InstitutionName.ShouldBe(request.InstitutionName); + response.DefaultCurrency.ShouldBe(request.DefaultCurrency); + response.Timezone.ShouldBe(request.Timezone); + response.SettlementMode.ShouldBe(request.SettlementMode); + } +} diff --git a/TransactionProcessorACL.IntegrationTests/Common/AgencyBankingAssertionsTests.cs b/TransactionProcessorACL.IntegrationTests/Common/AgencyBankingAssertionsTests.cs new file mode 100644 index 0000000..922bbb7 --- /dev/null +++ b/TransactionProcessorACL.IntegrationTests/Common/AgencyBankingAssertionsTests.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using TestHosts.DataTransferObjects.AgencyBanking; + +namespace TransactionProcessor.IntegrationTests.Common; + +[TestFixture] +public class AgencyBankingAssertionsTests +{ + [Test] + public void VerifyGlAccount_rejects_a_persisted_account_with_the_wrong_code() + { + CreateGlAccountRequest request = new() + { + GlCode = "1000", + GlName = "Cash", + GlType = "Asset", + Currency = "KES" + }; + + GlAccountResponse response = new() + { + GlCode = "2000", + GlName = request.GlName, + GlType = request.GlType, + Currency = request.Currency + }; + + Assert.Throws(() => AgencyBankingAssertions.VerifyGlAccount(response, request)); + } +} diff --git a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs index 16e6d75..1fdd74a 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs @@ -97,7 +97,7 @@ public override ContainerBuilder SetupTransactionProcessorContainer() return base.SetupTransactionProcessorContainer(); } - public override async Task CreateSubscriptions(){ + public override async Task CreateSubscriptions(CancellationToken cancellationToken){ List<(String streamName, String groupName, Int32 maxRetries)> subscriptions = new List<(String streamName, String groupName, Int32 maxRetries)>(); subscriptions.AddRange(MessagingService.IntegrationTesting.Helpers.SubscriptionsHelper.GetSubscriptions()); subscriptions.AddRange(TransactionProcessor.IntegrationTesting.Helpers.SubscriptionsHelper.GetSubscriptions()); @@ -114,11 +114,11 @@ public override async Task CreateSubscriptions(){ /// Starts the containers for scenario run. /// /// Name of the scenario. - public override async Task StartContainersForScenarioRun(String scenarioName, DockerServices dockerServices) + public override async Task StartContainersForScenarioRun(String scenarioName, DockerServices dockerServices, CancellationToken cancellationToken) { try { - await base.StartContainersForScenarioRun(scenarioName, dockerServices); + await base.StartContainersForScenarioRun(scenarioName, dockerServices, cancellationToken); } catch { @@ -229,6 +229,11 @@ public override Dictionary GetAdditionalVariables(ContainerType $"http://{this.EstateReportingContainerName}:{DockerPorts.EstateReportingDockerPort}"; } + if (containerType == ContainerType.TransactionProcessorAcl) + { + additionalVariables["Logging:LogLevel:Microsoft.AspNetCore.Authorization"] = "Debug"; + } + return additionalVariables; } @@ -236,6 +241,7 @@ public override ContainerBuilder SetupSecurityServiceContainer() { Dictionary additionalVariables = new(); additionalVariables.Add("ServiceOptions:OAuth:LegacyGrantTypeClients:password:1", "estateClient"); + additionalVariables.Add("ServiceOptions:OAuth:LegacyGrantTypeClients:password:2", "redemptionClient"); additionalVariables.Add("ServiceOptions:UserOptions:UseProvidedPasswordForEmailUsers", "true"); this.AdditionalVariables.Add(ContainerType.SecurityService, additionalVariables); diff --git a/TransactionProcessorACL.IntegrationTests/Common/GenericSteps.cs b/TransactionProcessorACL.IntegrationTests/Common/GenericSteps.cs index d3f9147..56a188d 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/GenericSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/GenericSteps.cs @@ -59,7 +59,7 @@ public async Task StartSystem() this.TestingContext.Logger = logger; this.TestingContext.Logger.LogInformation("About to Start Containers for Scenario Run"); - await this.TestingContext.DockerHelper.StartContainersForScenarioRun(scenarioName, dockerServices).ConfigureAwait(false); + await this.TestingContext.DockerHelper.StartContainersForScenarioRun(scenarioName, dockerServices, CancellationToken.None).ConfigureAwait(false); this.TestingContext.Logger.LogInformation("Containers for Scenario Run Started"); } diff --git a/TransactionProcessorACL.IntegrationTests/Common/Retry.cs b/TransactionProcessorACL.IntegrationTests/Common/Retry.cs index a0c0912..d9a60cc 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/Retry.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/Retry.cs @@ -32,9 +32,9 @@ public static class Retry /// The retry for. /// The retry interval. /// - public static async Task For(Func action, - TimeSpan? retryFor = null, - TimeSpan? retryInterval = null) + public static async Task ForEventually(Func action, + TimeSpan? retryFor = null, + TimeSpan? retryInterval = null) { DateTime startTime = DateTime.Now; Exception lastException = null; @@ -57,7 +57,7 @@ public static async Task For(Func action, lastException = e; // wait before retrying - Thread.Sleep(retryInterval ?? Retry.DefaultRetryInterval); + await Task.Delay(retryInterval ?? Retry.DefaultRetryInterval).ConfigureAwait(false); } } diff --git a/TransactionProcessorACL.IntegrationTests/Common/RetryTests.cs b/TransactionProcessorACL.IntegrationTests/Common/RetryTests.cs new file mode 100644 index 0000000..f18169b --- /dev/null +++ b/TransactionProcessorACL.IntegrationTests/Common/RetryTests.cs @@ -0,0 +1,29 @@ +using NUnit.Framework; +using System; +using System.Threading.Tasks; + +namespace TransactionProcessor.IntegrationTests.Common; + +[TestFixture] +public class RetryTests +{ + [Test] + public async Task ForEventually_retries_a_transient_failure() + { + Int32 attempts = 0; + + await Retry.ForEventually(() => + { + attempts++; + + if (attempts == 1) + { + throw new InvalidOperationException("transient failure"); + } + + return Task.CompletedTask; + }, TimeSpan.FromSeconds(1), TimeSpan.Zero); + + Assert.That(attempts, Is.EqualTo(2)); + } +} diff --git a/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertions.cs b/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertions.cs new file mode 100644 index 0000000..0313449 --- /dev/null +++ b/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertions.cs @@ -0,0 +1,20 @@ +using Shouldly; +using System; +using TransactionProcessor.DataTransferObjects; + +namespace TransactionProcessor.IntegrationTests.Common; + +public static class TransactionResponseAssertions +{ + public static void Verify(TransactionResponse response, + Guid expectedEstateId, + Guid expectedMerchantId, + string expectedTransactionType) + { + response.ShouldNotBeNull(); + response.TransactionId.ShouldNotBe(Guid.Empty); + response.EstateId.ShouldBe(expectedEstateId); + response.MerchantId.ShouldBe(expectedMerchantId); + response.TransactionType.ShouldBe(expectedTransactionType); + } +} diff --git a/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertionsTests.cs b/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertionsTests.cs new file mode 100644 index 0000000..36326ad --- /dev/null +++ b/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertionsTests.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using TransactionProcessor.DataTransferObjects; +using System; + +namespace TransactionProcessor.IntegrationTests.Common; + +[TestFixture] +public class TransactionResponseAssertionsTests +{ + [Test] + public void Verify_rejects_a_response_for_the_wrong_merchant() + { + Guid estateId = Guid.NewGuid(); + Guid requestedMerchantId = Guid.NewGuid(); + TransactionResponse response = new() + { + EstateId = estateId, + MerchantId = Guid.NewGuid(), + TransactionId = Guid.NewGuid(), + TransactionType = "Sale" + }; + + Assert.Throws(() => + TransactionResponseAssertions.Verify(response, estateId, requestedMerchantId, "Sale")); + } +} diff --git a/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature.cs b/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature.cs index 7621a53..c68ee94 100644 --- a/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature.cs +++ b/TransactionProcessorACL.IntegrationTests/Merchants/Merchants.feature.cs @@ -111,174 +111,174 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table1 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table1.AddRow(new string[] { + table16.AddRow(new string[] { "Merchant"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table1, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table16, "Given "); #line hidden - global::Reqnroll.Table table2 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table2.AddRow(new string[] { + table17.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table2.AddRow(new string[] { + table17.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST Scope", "A scope for Transaction Processor ACL REST"}); #line 10 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table2, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table17, "Given "); #line hidden - global::Reqnroll.Table table3 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table3.AddRow(new string[] { + table18.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); - table3.AddRow(new string[] { + table18.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST", "Secret1", "transactionProcessorACL", "merchantId, estateId, role"}); #line 15 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table3, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table18, "Given "); #line hidden - global::Reqnroll.Table table4 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table4.AddRow(new string[] { + table19.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor,transactionProcessorACL", "client_credentials"}); - table4.AddRow(new string[] { + table19.AddRow(new string[] { "merchantClient", "Merchant Client", "Secret1", "transactionProcessorACL", "password"}); #line 20 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table4, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table19, "Given "); #line hidden - global::Reqnroll.Table table5 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table5.AddRow(new string[] { + table20.AddRow(new string[] { "serviceClient"}); #line 25 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor acl reso" + - "urces", ((string)(null)), table5, "Given "); + "urces", ((string)(null)), table20, "Given "); #line hidden - global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table21 = new global::Reqnroll.Table(new string[] { "AccountNumber", "AccountName", "DueDate", "Amount"}); - table6.AddRow(new string[] { + table21.AddRow(new string[] { "12345678", "Test Account 1", "Today", "100.00"}); #line 29 - await testRunner.GivenAsync("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table6, "Given "); + await testRunner.GivenAsync("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table21, "Given "); #line hidden - global::Reqnroll.Table table7 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table22 = new global::Reqnroll.Table(new string[] { "Username", "Password"}); - table7.AddRow(new string[] { + table22.AddRow(new string[] { "operatora", "1234567898"}); #line 33 - await testRunner.GivenAsync("the following users are available at the PataPawa PrePay Host", ((string)(null)), table7, "Given "); + await testRunner.GivenAsync("the following users are available at the PataPawa PrePay Host", ((string)(null)), table22, "Given "); #line hidden - global::Reqnroll.Table table8 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table23 = new global::Reqnroll.Table(new string[] { "MeterNumber", "CustomerName"}); - table8.AddRow(new string[] { + table23.AddRow(new string[] { "00000001", "Customer 1"}); - table8.AddRow(new string[] { + table23.AddRow(new string[] { "00000002", "Customer 2"}); - table8.AddRow(new string[] { + table23.AddRow(new string[] { "00000003", "Customer 3"}); #line 37 - await testRunner.GivenAsync("the following meters are available at the PataPawa PrePay Host", ((string)(null)), table8, "Given "); + await testRunner.GivenAsync("the following meters are available at the PataPawa PrePay Host", ((string)(null)), table23, "Given "); #line hidden #line 43 await testRunner.GivenAsync("I initialise the Agency Banking Host", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table9 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table24 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table9.AddRow(new string[] { + table24.AddRow(new string[] { "Test Estate 1"}); - table9.AddRow(new string[] { + table24.AddRow(new string[] { "Test Estate 2"}); #line 45 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table9, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table24, "Given "); #line hidden - global::Reqnroll.Table table10 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table25 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table10.AddRow(new string[] { + table25.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table10.AddRow(new string[] { + table25.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); - table10.AddRow(new string[] { + table25.AddRow(new string[] { "Test Estate 2", "Safaricom", "True", "True"}); - table10.AddRow(new string[] { + table25.AddRow(new string[] { "Test Estate 2", "Voucher", "True", "True"}); #line 50 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table10, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table25, "Given "); #line hidden - global::Reqnroll.Table table11 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table26 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table11.AddRow(new string[] { + table26.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table11.AddRow(new string[] { + table26.AddRow(new string[] { "Test Estate 1", "Voucher"}); - table11.AddRow(new string[] { + table26.AddRow(new string[] { "Test Estate 2", "Safaricom"}); - table11.AddRow(new string[] { + table26.AddRow(new string[] { "Test Estate 2", "Voucher"}); #line 57 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table11, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table26, "And "); #line hidden - global::Reqnroll.Table table12 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table27 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -288,7 +288,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table12.AddRow(new string[] { + table27.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -298,7 +298,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table12.AddRow(new string[] { + table27.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -308,7 +308,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table12.AddRow(new string[] { + table27.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -319,75 +319,75 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact3@merchant2.co.uk", "Test Estate 2"}); #line 64 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table12, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table27, "Given "); #line hidden - global::Reqnroll.Table table13 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table28 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table13.AddRow(new string[] { + table28.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table13.AddRow(new string[] { + table28.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table13.AddRow(new string[] { + table28.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table13.AddRow(new string[] { + table28.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table13.AddRow(new string[] { + table28.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); - table13.AddRow(new string[] { + table28.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); #line 70 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table13, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table28, "Given "); #line hidden - global::Reqnroll.Table table14 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table29 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName", "MerchantName"}); - table14.AddRow(new string[] { + table29.AddRow(new string[] { "merchantuser@testmerchant1.co.uk", "123456", "TestMerchant", "User1", "Test Estate 1", "Test Merchant 1"}); - table14.AddRow(new string[] { + table29.AddRow(new string[] { "merchantuser@testmerchant2.co.uk", "123456", "TestMerchant", "User2", "Test Estate 1", "Test Merchant 2"}); - table14.AddRow(new string[] { + table29.AddRow(new string[] { "merchantuser@testmerchant3.co.uk", "123456", "TestMerchant", @@ -395,32 +395,32 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 2", "Test Merchant 3"}); #line 79 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table14, "Given "); + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table29, "Given "); #line hidden - global::Reqnroll.Table table15 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table30 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table15.AddRow(new string[] { + table30.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table15.AddRow(new string[] { + table30.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table15.AddRow(new string[] { + table30.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); - table15.AddRow(new string[] { + table30.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract"}); #line 85 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table15, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table30, "Given "); #line hidden - global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table31 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -428,7 +428,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table16.AddRow(new string[] { + table31.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -436,7 +436,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table16.AddRow(new string[] { + table31.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -444,7 +444,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); - table16.AddRow(new string[] { + table31.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -452,7 +452,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table16.AddRow(new string[] { + table31.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract", @@ -461,9 +461,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Voucher"}); #line 92 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table16, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table31, "When "); #line hidden - global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table32 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -471,7 +471,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table17.AddRow(new string[] { + table32.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -479,7 +479,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Fixed", "Merchant Commission", "2.50"}); - table17.AddRow(new string[] { + table32.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -488,38 +488,38 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Commission", "0.85"}); #line 99 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table17, "When "); + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table32, "When "); #line hidden - global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table33 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table18.AddRow(new string[] { + table33.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table18.AddRow(new string[] { + table33.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table18.AddRow(new string[] { + table33.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table18.AddRow(new string[] { + table33.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Hospital 1 Contract"}); - table18.AddRow(new string[] { + table33.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Safaricom Contract"}); - table18.AddRow(new string[] { + table33.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Hospital 1 Contract"}); #line 104 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table18, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table33, "When "); #line hidden } @@ -556,7 +556,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table34 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -564,7 +564,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Country", "ContactName", "EmailAddress"}); - table19.AddRow(new string[] { + table34.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -574,7 +574,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact1@merchant1.co.uk"}); #line 116 await testRunner.WhenAsync("I get the merchant information for Merchant \"Test Merchant 1\" for Estate \"Test Es" + - "tate 1\" the response should contain the following information", ((string)(null)), table19, "When "); + "tate 1\" the response should contain the following information", ((string)(null)), table34, "When "); #line hidden } await this.ScenarioCleanupAsync(); @@ -608,18 +608,18 @@ await testRunner.GivenAsync("I have a token to access the estate management and "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table35 = new global::Reqnroll.Table(new string[] { "MerchantName", "ContractDescription"}); - table20.AddRow(new string[] { + table35.AddRow(new string[] { "Test Merchant 1", "Safaricom Contract"}); - table20.AddRow(new string[] { + table35.AddRow(new string[] { "Test Merchant 1", "Hospital 1 Contract"}); #line 122 await testRunner.WhenAsync("I get the merchant contract information for Merchant \"Test Merchant 1\" for Estate" + - " \"Test Estate 1\" the response should contain the following information", ((string)(null)), table20, "When "); + " \"Test Estate 1\" the response should contain the following information", ((string)(null)), table35, "When "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/TransactionProcessorACL.IntegrationTests/Reconciliation/Reconciliation.feature.cs b/TransactionProcessorACL.IntegrationTests/Reconciliation/Reconciliation.feature.cs index 693fa45..134ccbd 100644 --- a/TransactionProcessorACL.IntegrationTests/Reconciliation/Reconciliation.feature.cs +++ b/TransactionProcessorACL.IntegrationTests/Reconciliation/Reconciliation.feature.cs @@ -111,133 +111,133 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table33 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table36 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table33.AddRow(new string[] { + table36.AddRow(new string[] { "Merchant"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table33, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table36, "Given "); #line hidden - global::Reqnroll.Table table34 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table37 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table34.AddRow(new string[] { + table37.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table34.AddRow(new string[] { + table37.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST Scope", "A scope for Transaction Processor ACL REST"}); #line 10 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table34, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table37, "Given "); #line hidden - global::Reqnroll.Table table35 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table38 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table35.AddRow(new string[] { + table38.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); - table35.AddRow(new string[] { + table38.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST", "Secret1", "transactionProcessorACL", "merchantId, estateId, role"}); #line 15 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table35, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table38, "Given "); #line hidden - global::Reqnroll.Table table36 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table39 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table36.AddRow(new string[] { + table39.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor,transactionProcessorACL", "client_credentials"}); - table36.AddRow(new string[] { + table39.AddRow(new string[] { "merchantClient", "Merchant Client", "Secret1", "transactionProcessorACL", "password"}); #line 20 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table36, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table39, "Given "); #line hidden - global::Reqnroll.Table table37 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table40 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table37.AddRow(new string[] { + table40.AddRow(new string[] { "serviceClient"}); #line 25 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor acl reso" + - "urces", ((string)(null)), table37, "Given "); + "urces", ((string)(null)), table40, "Given "); #line hidden - global::Reqnroll.Table table38 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table41 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table38.AddRow(new string[] { + table41.AddRow(new string[] { "Test Estate 1"}); - table38.AddRow(new string[] { + table41.AddRow(new string[] { "Test Estate 2"}); #line 29 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table38, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table41, "Given "); #line hidden - global::Reqnroll.Table table39 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table42 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table39.AddRow(new string[] { + table42.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table39.AddRow(new string[] { + table42.AddRow(new string[] { "Test Estate 2", "Safaricom", "True", "True"}); #line 34 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table39, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table42, "Given "); #line hidden - global::Reqnroll.Table table40 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table43 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table40.AddRow(new string[] { + table43.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table40.AddRow(new string[] { + table43.AddRow(new string[] { "Test Estate 2", "Safaricom"}); #line 39 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table40, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table43, "And "); #line hidden - global::Reqnroll.Table table41 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table44 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table41.AddRow(new string[] { + table44.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table41.AddRow(new string[] { + table44.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); #line 44 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table41, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table44, "Given "); #line hidden - global::Reqnroll.Table table42 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table45 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -245,7 +245,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table42.AddRow(new string[] { + table45.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -253,7 +253,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table42.AddRow(new string[] { + table45.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -262,9 +262,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "MobileTopup"}); #line 49 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table42, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table45, "When "); #line hidden - global::Reqnroll.Table table43 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table46 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -272,7 +272,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table43.AddRow(new string[] { + table46.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -280,7 +280,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Fixed", "Merchant Commission", "2.50"}); - table43.AddRow(new string[] { + table46.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -289,9 +289,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Commission", "0.85"}); #line 54 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table43, "When "); + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table46, "When "); #line hidden - global::Reqnroll.Table table44 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table47 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -301,7 +301,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table44.AddRow(new string[] { + table47.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -311,7 +311,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table44.AddRow(new string[] { + table47.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -321,7 +321,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table44.AddRow(new string[] { + table47.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -332,122 +332,122 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact3@merchant2.co.uk", "Test Estate 2"}); #line 59 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table44, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table47, "Given "); #line hidden - global::Reqnroll.Table table45 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table48 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table45.AddRow(new string[] { + table48.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table45.AddRow(new string[] { + table48.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table45.AddRow(new string[] { + table48.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); #line 65 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table45, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table48, "Given "); #line hidden - global::Reqnroll.Table table46 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table49 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table46.AddRow(new string[] { + table49.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table46.AddRow(new string[] { + table49.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table46.AddRow(new string[] { + table49.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 2"}); #line 71 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table46, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table49, "Given "); #line hidden - global::Reqnroll.Table table47 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table50 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table47.AddRow(new string[] { + table50.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table47.AddRow(new string[] { + table50.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table47.AddRow(new string[] { + table50.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Safaricom Contract"}); #line 77 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table47, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table50, "When "); #line hidden - global::Reqnroll.Table table48 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table51 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table48.AddRow(new string[] { + table51.AddRow(new string[] { "Deposit1", "200.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table48.AddRow(new string[] { + table51.AddRow(new string[] { "Deposit1", "100.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table48.AddRow(new string[] { + table51.AddRow(new string[] { "Deposit1", "100.00", "Today", "Test Merchant 3", "Test Estate 2"}); #line 83 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table48, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table51, "Given "); #line hidden - global::Reqnroll.Table table49 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table52 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName", "MerchantName"}); - table49.AddRow(new string[] { + table52.AddRow(new string[] { "merchantuser@testmerchant1.co.uk", "123456", "TestMerchant", "User1", "Test Estate 1", "Test Merchant 1"}); - table49.AddRow(new string[] { + table52.AddRow(new string[] { "merchantuser@testmerchant2.co.uk", "123456", "TestMerchant", "User2", "Test Estate 1", "Test Merchant 2"}); - table49.AddRow(new string[] { + table52.AddRow(new string[] { "merchantuser@testmerchant3.co.uk", "123456", "TestMerchant", @@ -455,7 +455,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 2", "Test Merchant 3"}); #line 89 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table49, "Given "); + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table52, "Given "); #line hidden } @@ -494,7 +494,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table50 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table53 = new global::Reqnroll.Table(new string[] { "DateTime", "MerchantName", "DeviceIdentifier", @@ -503,7 +503,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "TransactionValue", "TransactionNumber", "TransactionType"}); - table50.AddRow(new string[] { + table53.AddRow(new string[] { "Today", "Test Merchant 1", "123456780", @@ -513,14 +513,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and "1", "Reconciliation"}); #line 98 - await testRunner.WhenAsync("I perform the following reconciliations", ((string)(null)), table50, "When "); + await testRunner.WhenAsync("I perform the following reconciliations", ((string)(null)), table53, "When "); #line hidden #line 102 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant2.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 2\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table51 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table54 = new global::Reqnroll.Table(new string[] { "DateTime", "MerchantName", "DeviceIdentifier", @@ -529,7 +529,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "TransactionValue", "TransactionNumber", "TransactionType"}); - table51.AddRow(new string[] { + table54.AddRow(new string[] { "Today", "Test Merchant 2", "123456781", @@ -539,14 +539,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and "2", "Reconciliation"}); #line 103 - await testRunner.WhenAsync("I perform the following reconciliations", ((string)(null)), table51, "When "); + await testRunner.WhenAsync("I perform the following reconciliations", ((string)(null)), table54, "When "); #line hidden #line 107 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant3.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 3\" for Estate \"Test Estate 2\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table52 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table55 = new global::Reqnroll.Table(new string[] { "DateTime", "MerchantName", "DeviceIdentifier", @@ -555,7 +555,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "TransactionValue", "TransactionNumber", "TransactionType"}); - table52.AddRow(new string[] { + table55.AddRow(new string[] { "Today", "Test Merchant 3", "123456782", @@ -565,34 +565,34 @@ await testRunner.GivenAsync("I have a token to access the estate management and "3", "Reconciliation"}); #line 108 - await testRunner.WhenAsync("I perform the following reconciliations", ((string)(null)), table52, "When "); + await testRunner.WhenAsync("I perform the following reconciliations", ((string)(null)), table55, "When "); #line hidden - global::Reqnroll.Table table53 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table56 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "ResponseCode", "ResponseMessage"}); - table53.AddRow(new string[] { + table56.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "0000", "SUCCESS"}); - table53.AddRow(new string[] { + table56.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "0000", "SUCCESS"}); - table53.AddRow(new string[] { + table56.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "3", "0000", "SUCCESS"}); #line 112 - await testRunner.ThenAsync("the reconciliation response should contain the following information", ((string)(null)), table53, "Then "); + await testRunner.ThenAsync("the reconciliation response should contain the following information", ((string)(null)), table56, "Then "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/TransactionProcessorACL.IntegrationTests/RedeemVoucher/RedeemVoucher.feature.cs b/TransactionProcessorACL.IntegrationTests/RedeemVoucher/RedeemVoucher.feature.cs index 6d23c3f..ded5903 100644 --- a/TransactionProcessorACL.IntegrationTests/RedeemVoucher/RedeemVoucher.feature.cs +++ b/TransactionProcessorACL.IntegrationTests/RedeemVoucher/RedeemVoucher.feature.cs @@ -111,110 +111,110 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table54 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table57 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table54.AddRow(new string[] { + table57.AddRow(new string[] { "Merchant"}); - table54.AddRow(new string[] { + table57.AddRow(new string[] { "VoucherRedemption"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table54, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table57, "Given "); #line hidden - global::Reqnroll.Table table55 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table58 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table55.AddRow(new string[] { + table58.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table55.AddRow(new string[] { + table58.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST Scope", "A scope for Transaction Processor ACL REST"}); #line 11 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table55, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table58, "Given "); #line hidden - global::Reqnroll.Table table56 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table59 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table56.AddRow(new string[] { + table59.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); - table56.AddRow(new string[] { + table59.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST", "Secret1", "transactionProcessorACL", "merchantId, estateId, role, contractId"}); #line 16 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table56, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table59, "Given "); #line hidden - global::Reqnroll.Table table57 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table60 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table57.AddRow(new string[] { + table60.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor,transactionProcessorACL", "client_credentials"}); - table57.AddRow(new string[] { + table60.AddRow(new string[] { "merchantClient", "Merchant Client", "Secret1", "transactionProcessorACL", "password"}); - table57.AddRow(new string[] { + table60.AddRow(new string[] { "redemptionClient", "Redemption Client", "Secret1", "transactionProcessorACL", "password"}); #line 21 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table57, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table60, "Given "); #line hidden - global::Reqnroll.Table table58 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table61 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table58.AddRow(new string[] { + table61.AddRow(new string[] { "serviceClient"}); #line 27 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor acl reso" + - "urces", ((string)(null)), table58, "Given "); + "urces", ((string)(null)), table61, "Given "); #line hidden - global::Reqnroll.Table table59 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table62 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table59.AddRow(new string[] { + table62.AddRow(new string[] { "Test Estate 1"}); - table59.AddRow(new string[] { + table62.AddRow(new string[] { "Test Estate 2"}); #line 31 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table59, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table62, "Given "); #line hidden - global::Reqnroll.Table table60 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table63 = new global::Reqnroll.Table(new string[] { "Email Address", "Password", "Given Name", "Family Name", "EstateName", "Roles"}); - table60.AddRow(new string[] { + table63.AddRow(new string[] { "redemptionuser@testredemption1.co.uk", "123456", "TestRedemption", "User1", "Test Estate 1", "VoucherRedemption"}); - table60.AddRow(new string[] { + table63.AddRow(new string[] { "redemptionuser@testredemption2.co.uk", "123456", "TestRedemption", @@ -222,54 +222,54 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 2", "VoucherRedemption"}); #line 36 - await testRunner.GivenAsync("I have created the following security users for voucher redemption", ((string)(null)), table60, "Given "); + await testRunner.GivenAsync("I have created the following security users for voucher redemption", ((string)(null)), table63, "Given "); #line hidden - global::Reqnroll.Table table61 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table64 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table61.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); - table61.AddRow(new string[] { + table64.AddRow(new string[] { "Test Estate 2", "Voucher", "True", "True"}); #line 41 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table61, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table64, "Given "); #line hidden - global::Reqnroll.Table table62 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table65 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table62.AddRow(new string[] { + table65.AddRow(new string[] { "Test Estate 1", "Voucher"}); - table62.AddRow(new string[] { + table65.AddRow(new string[] { "Test Estate 2", "Voucher"}); #line 46 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table62, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table65, "And "); #line hidden - global::Reqnroll.Table table63 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table66 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table63.AddRow(new string[] { + table66.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table63.AddRow(new string[] { + table66.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 2 Contract"}); #line 51 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table63, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table66, "Given "); #line hidden - global::Reqnroll.Table table64 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table67 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -277,7 +277,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table64.AddRow(new string[] { + table67.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -285,7 +285,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); - table64.AddRow(new string[] { + table67.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 2 Contract", @@ -294,9 +294,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Voucher"}); #line 56 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table64, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table67, "When "); #line hidden - global::Reqnroll.Table table65 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table68 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -306,7 +306,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table65.AddRow(new string[] { + table68.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -316,7 +316,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table65.AddRow(new string[] { + table68.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -327,95 +327,95 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact1@merchant1.co.uk", "Test Estate 2"}); #line 61 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table65, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table68, "Given "); #line hidden - global::Reqnroll.Table table66 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table69 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table66.AddRow(new string[] { + table69.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table66.AddRow(new string[] { + table69.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 2"}); #line 66 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table66, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table69, "Given "); #line hidden - global::Reqnroll.Table table67 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table70 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table67.AddRow(new string[] { + table70.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table67.AddRow(new string[] { + table70.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 2"}); #line 71 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table67, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table70, "Given "); #line hidden - global::Reqnroll.Table table68 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table71 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table68.AddRow(new string[] { + table71.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table68.AddRow(new string[] { + table71.AddRow(new string[] { "Test Estate 2", "Test Merchant 2", "Hospital 2 Contract"}); #line 76 -await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table68, "When "); +await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table71, "When "); #line hidden - global::Reqnroll.Table table69 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table72 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table69.AddRow(new string[] { + table72.AddRow(new string[] { "Deposit1", "20.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table69.AddRow(new string[] { + table72.AddRow(new string[] { "Deposit1", "20.00", "Today", "Test Merchant 2", "Test Estate 2"}); #line 81 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table69, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table72, "Given "); #line hidden - global::Reqnroll.Table table70 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table73 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName", "MerchantName"}); - table70.AddRow(new string[] { + table73.AddRow(new string[] { "merchantuser@testmerchant1.co.uk", "123456", "TestMerchant", "User1", "Test Estate 1", "Test Merchant 1"}); - table70.AddRow(new string[] { + table73.AddRow(new string[] { "merchantuser@testmerchant2.co.uk", "123456", "TestMerchant", @@ -423,14 +423,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 2", "Test Merchant 2"}); #line 86 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table70, "Given "); + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table73, "Given "); #line hidden #line 91 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant1.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table71 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table74 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -449,7 +449,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "MessageType", "AccountNumber", "CustomerName"}); - table71.AddRow(new string[] { + table74.AddRow(new string[] { "Today", "1", "Sale", @@ -469,14 +469,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", ""}); #line 93 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table71, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table74, "When "); #line hidden #line 97 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant2.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 2\" for Estate \"Test Estate 2\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table72 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table75 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -495,7 +495,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "MessageType", "AccountNumber", "CustomerName"}); - table72.AddRow(new string[] { + table75.AddRow(new string[] { "Today", "2", "Sale", @@ -515,7 +515,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", ""}); #line 99 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table72, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table75, "When "); #line hidden } diff --git a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature index 16612ba..542e6bf 100644 --- a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature +++ b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature @@ -22,7 +22,7 @@ Background: Given the following clients exist | ClientId | ClientName | Secret | Scopes | GrantTypes | | serviceClient | Service Client | Secret1 | transactionProcessor,transactionProcessorACL, estateReporting | client_credentials | - | merchantClient | Merchant Client | Secret1 | transactionProcessorACL, estateReporting | password | + | merchantClient | Merchant Client | Secret1 | transactionProcessorACL | password | Given I have a token to access the estate management and transaction processor acl resources | ClientId | diff --git a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs index 13b68a5..c66f2c1 100644 --- a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs +++ b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs @@ -113,167 +113,167 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table1 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table76 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table1.AddRow(new string[] { + table76.AddRow(new string[] { "Merchant"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table1, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table76, "Given "); #line hidden - global::Reqnroll.Table table2 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table77 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table2.AddRow(new string[] { + table77.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table2.AddRow(new string[] { + table77.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST Scope", "A scope for Transaction Processor ACL REST"}); - table2.AddRow(new string[] { + table77.AddRow(new string[] { "estateReporting", "Estate Reporting REST Scope", "Scope for Estate Reporting REST"}); #line 10 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table2, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table77, "Given "); #line hidden - global::Reqnroll.Table table3 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table78 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table3.AddRow(new string[] { + table78.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); - table3.AddRow(new string[] { + table78.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST", "Secret1", "transactionProcessorACL", "merchantId, estateId, role"}); - table3.AddRow(new string[] { + table78.AddRow(new string[] { "estateReporting", "Estate Reporting REST", "Secret1", "estateReporting", "merchantId,estateId,role"}); #line 16 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table3, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table78, "Given "); #line hidden - global::Reqnroll.Table table4 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table79 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table4.AddRow(new string[] { + table79.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor,transactionProcessorACL, estateReporting", "client_credentials"}); - table4.AddRow(new string[] { + table79.AddRow(new string[] { "merchantClient", "Merchant Client", "Secret1", - "transactionProcessorACL, estateReporting", + "transactionProcessorACL", "password"}); #line 22 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table4, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table79, "Given "); #line hidden - global::Reqnroll.Table table5 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table80 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table5.AddRow(new string[] { + table80.AddRow(new string[] { "serviceClient"}); #line 27 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor acl reso" + - "urces", ((string)(null)), table5, "Given "); + "urces", ((string)(null)), table80, "Given "); #line hidden - global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table81 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table6.AddRow(new string[] { + table81.AddRow(new string[] { "Test Estate 1"}); - table6.AddRow(new string[] { + table81.AddRow(new string[] { "Test Estate 2"}); #line 31 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table6, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table81, "Given "); #line hidden - global::Reqnroll.Table table7 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table82 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table7.AddRow(new string[] { + table82.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table7.AddRow(new string[] { + table82.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); - table7.AddRow(new string[] { + table82.AddRow(new string[] { "Test Estate 2", "Safaricom", "True", "True"}); - table7.AddRow(new string[] { + table82.AddRow(new string[] { "Test Estate 2", "Voucher", "True", "True"}); #line 36 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table7, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table82, "Given "); #line hidden - global::Reqnroll.Table table8 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table83 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table8.AddRow(new string[] { + table83.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table8.AddRow(new string[] { + table83.AddRow(new string[] { "Test Estate 1", "Voucher"}); - table8.AddRow(new string[] { + table83.AddRow(new string[] { "Test Estate 2", "Safaricom"}); - table8.AddRow(new string[] { + table83.AddRow(new string[] { "Test Estate 2", "Voucher"}); #line 43 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table8, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table83, "And "); #line hidden - global::Reqnroll.Table table9 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table84 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table9.AddRow(new string[] { + table84.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table9.AddRow(new string[] { + table84.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table9.AddRow(new string[] { + table84.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); - table9.AddRow(new string[] { + table84.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract"}); #line 50 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table9, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table84, "Given "); #line hidden - global::Reqnroll.Table table10 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table85 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -281,7 +281,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table10.AddRow(new string[] { + table85.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -289,7 +289,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table10.AddRow(new string[] { + table85.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -297,7 +297,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); - table10.AddRow(new string[] { + table85.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -305,7 +305,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table10.AddRow(new string[] { + table85.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract", @@ -314,9 +314,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "Voucher"}); #line 57 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table10, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table85, "When "); #line hidden - global::Reqnroll.Table table11 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table86 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -324,7 +324,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table11.AddRow(new string[] { + table86.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -332,7 +332,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Fixed", "Merchant Commission", "2.50"}); - table11.AddRow(new string[] { + table86.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -341,9 +341,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Commission", "0.85"}); #line 64 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table11, "When "); + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table86, "When "); #line hidden - global::Reqnroll.Table table12 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table87 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -353,7 +353,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table12.AddRow(new string[] { + table87.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -363,7 +363,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table12.AddRow(new string[] { + table87.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -373,7 +373,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table12.AddRow(new string[] { + table87.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -384,152 +384,152 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact3@merchant2.co.uk", "Test Estate 2"}); #line 69 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table12, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table87, "Given "); #line hidden - global::Reqnroll.Table table13 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table88 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table13.AddRow(new string[] { + table88.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table13.AddRow(new string[] { + table88.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table13.AddRow(new string[] { + table88.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table13.AddRow(new string[] { + table88.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table13.AddRow(new string[] { + table88.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); - table13.AddRow(new string[] { + table88.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); #line 75 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table13, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table88, "Given "); #line hidden - global::Reqnroll.Table table14 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table89 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table14.AddRow(new string[] { + table89.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table14.AddRow(new string[] { + table89.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table14.AddRow(new string[] { + table89.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 2"}); #line 84 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table14, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table89, "Given "); #line hidden - global::Reqnroll.Table table15 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table90 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table15.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table15.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table15.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table15.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Hospital 1 Contract"}); - table15.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Safaricom Contract"}); - table15.AddRow(new string[] { + table90.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Hospital 1 Contract"}); #line 90 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table15, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table90, "When "); #line hidden - global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table91 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table16.AddRow(new string[] { + table91.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table16.AddRow(new string[] { + table91.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table16.AddRow(new string[] { + table91.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 3", "Test Estate 2"}); #line 99 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table16, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table91, "Given "); #line hidden - global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table92 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName", "MerchantName"}); - table17.AddRow(new string[] { + table92.AddRow(new string[] { "merchantuser@testmerchant1.co.uk", "123456", "TestMerchant", "User1", "Test Estate 1", "Test Merchant 1"}); - table17.AddRow(new string[] { + table92.AddRow(new string[] { "merchantuser@testmerchant2.co.uk", "123456", "TestMerchant", "User2", "Test Estate 1", "Test Merchant 2"}); - table17.AddRow(new string[] { + table92.AddRow(new string[] { "merchantuser@testmerchant3.co.uk", "123456", "TestMerchant", @@ -537,7 +537,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 2", "Test Merchant 3"}); #line 105 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table17, "Given "); + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table92, "Given "); #line hidden } @@ -576,7 +576,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table93 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -591,7 +591,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ProductName", "RecipientEmail", "RecipientMobile"}); - table18.AddRow(new string[] { + table93.AddRow(new string[] { "Today", "8", "Sale", @@ -607,7 +607,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", ""}); #line 114 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table18, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table93, "When "); #line hidden #line 118 await testRunner.WhenAsync("I get the merchant daily performance summary for Merchant \"Test Merchant 1\" for E" + @@ -651,7 +651,7 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table94 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -666,7 +666,7 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou "ProductName", "RecipientEmail", "RecipientMobile"}); - table19.AddRow(new string[] { + table94.AddRow(new string[] { "Today", "9", "Sale", @@ -682,7 +682,7 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou "", ""}); #line 124 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table19, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table94, "When "); #line hidden #line 128 await testRunner.WhenAsync("I get the merchant transaction mix summary for Merchant \"Test Merchant 1\" for Est" + @@ -726,7 +726,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table95 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -741,7 +741,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "ProductName", "RecipientEmail", "RecipientMobile"}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1001", "Sale", @@ -756,7 +756,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1002", "Sale", @@ -771,7 +771,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1003", "Sale", @@ -786,7 +786,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1004", "Sale", @@ -801,7 +801,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1005", "Sale", @@ -816,7 +816,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1006", "Sale", @@ -831,7 +831,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1007", "Sale", @@ -846,7 +846,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1008", "Sale", @@ -861,7 +861,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1009", "Sale", @@ -876,7 +876,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table20.AddRow(new string[] { + table95.AddRow(new string[] { "Today", "1010", "Sale", @@ -892,7 +892,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "", ""}); #line 134 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table20, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table95, "When "); #line hidden #line 147 await testRunner.WhenAsync("I get the recent activity receipt search for Merchant \"Test Merchant 1\" for Estat" + diff --git a/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature.cs b/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature.cs index a668b1a..2a30933 100644 --- a/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature.cs +++ b/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature.cs @@ -111,330 +111,330 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table93 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table96 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table93.AddRow(new string[] { + table96.AddRow(new string[] { "Merchant"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table93, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table96, "Given "); #line hidden - global::Reqnroll.Table table94 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table97 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table94.AddRow(new string[] { + table97.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table94.AddRow(new string[] { + table97.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST Scope", "A scope for Transaction Processor ACL REST"}); #line 10 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table94, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table97, "Given "); #line hidden - global::Reqnroll.Table table95 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table98 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table95.AddRow(new string[] { + table98.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); - table95.AddRow(new string[] { + table98.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST", "Secret1", "transactionProcessorACL", "merchantId, estateId, role"}); #line 15 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table95, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table98, "Given "); #line hidden - global::Reqnroll.Table table96 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table99 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table96.AddRow(new string[] { + table99.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor,transactionProcessorACL", "client_credentials"}); - table96.AddRow(new string[] { + table99.AddRow(new string[] { "merchantClient", "Merchant Client", "Secret1", "transactionProcessorACL", "password"}); #line 20 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table96, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table99, "Given "); #line hidden - global::Reqnroll.Table table97 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table100 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table97.AddRow(new string[] { + table100.AddRow(new string[] { "serviceClient"}); #line 25 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor acl reso" + - "urces", ((string)(null)), table97, "Given "); + "urces", ((string)(null)), table100, "Given "); #line hidden - global::Reqnroll.Table table98 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table101 = new global::Reqnroll.Table(new string[] { "AccountNumber", "AccountName", "DueDate", "Amount"}); - table98.AddRow(new string[] { + table101.AddRow(new string[] { "12345678", "Test Account 1", "Today", "100.00"}); #line 29 - await testRunner.GivenAsync("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table98, "Given "); + await testRunner.GivenAsync("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table101, "Given "); #line hidden - global::Reqnroll.Table table99 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table102 = new global::Reqnroll.Table(new string[] { "Username", "Password"}); - table99.AddRow(new string[] { + table102.AddRow(new string[] { "operatora", "1234567898"}); #line 33 - await testRunner.GivenAsync("the following users are available at the PataPawa PrePay Host", ((string)(null)), table99, "Given "); + await testRunner.GivenAsync("the following users are available at the PataPawa PrePay Host", ((string)(null)), table102, "Given "); #line hidden - global::Reqnroll.Table table100 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table103 = new global::Reqnroll.Table(new string[] { "MeterNumber", "CustomerName"}); - table100.AddRow(new string[] { + table103.AddRow(new string[] { "00000001", "Customer 1"}); - table100.AddRow(new string[] { + table103.AddRow(new string[] { "00000002", "Customer 2"}); - table100.AddRow(new string[] { + table103.AddRow(new string[] { "00000003", "Customer 3"}); #line 37 - await testRunner.GivenAsync("the following meters are available at the PataPawa PrePay Host", ((string)(null)), table100, "Given "); + await testRunner.GivenAsync("the following meters are available at the PataPawa PrePay Host", ((string)(null)), table103, "Given "); #line hidden #line 43 await testRunner.GivenAsync("I initialise the Agency Banking Host", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table101 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table104 = new global::Reqnroll.Table(new string[] { "Type", "Code", "Name", "Currency"}); - table101.AddRow(new string[] { + table104.AddRow(new string[] { "LIABILITY", "200100", "Agent Float GL", "KES"}); - table101.AddRow(new string[] { + table104.AddRow(new string[] { "LIABILITY", "200200", "Settlement Suspense GL", "KES"}); - table101.AddRow(new string[] { + table104.AddRow(new string[] { "EXPENSE", "400100", "Agent Commission GL", "KES"}); - table101.AddRow(new string[] { + table104.AddRow(new string[] { "LIABILITY", "200300", "Reversal GL", "KES"}); - table101.AddRow(new string[] { + table104.AddRow(new string[] { "INCOME", "400200", "Fee Income GL", "KES"}); #line 45 - await testRunner.GivenAsync("I create the following accounts", ((string)(null)), table101, "Given "); + await testRunner.GivenAsync("I create the following accounts", ((string)(null)), table104, "Given "); #line hidden - global::Reqnroll.Table table102 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table105 = new global::Reqnroll.Table(new string[] { "AccountNumber", "BankCode", "Currency", "AccountName"}); - table102.AddRow(new string[] { + table105.AddRow(new string[] { "999000001", "001", "KES", "Main Settlement Account"}); #line 53 - await testRunner.GivenAsync("I create the settlement account", ((string)(null)), table102, "Given "); + await testRunner.GivenAsync("I create the settlement account", ((string)(null)), table105, "Given "); #line hidden - global::Reqnroll.Table table103 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table106 = new global::Reqnroll.Table(new string[] { "CustomerId", "FullName", "PhoneNumber", "NationalId", "AccountNumber"}); - table103.AddRow(new string[] { + table106.AddRow(new string[] { "CUST001", "Test Customer 1", "0712345678", "12345678", "12345678"}); #line 57 - await testRunner.GivenAsync("I create the following customers", ((string)(null)), table103, "Given "); + await testRunner.GivenAsync("I create the following customers", ((string)(null)), table106, "Given "); #line hidden - global::Reqnroll.Table table104 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table107 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table104.AddRow(new string[] { + table107.AddRow(new string[] { "Test Estate 1"}); - table104.AddRow(new string[] { + table107.AddRow(new string[] { "Test Estate 2"}); #line 61 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table104, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table107, "Given "); #line hidden - global::Reqnroll.Table table105 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table108 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "False", "False"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay", "False", "False"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 1", "AgencyBanking", "False", "False"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 2", "Safaricom", "True", "True"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 2", "Voucher", "True", "True"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 2", "PataPawa PostPay", "False", "False"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 2", "PataPawa PrePay", "False", "False"}); - table105.AddRow(new string[] { + table108.AddRow(new string[] { "Test Estate 2", "AgencyBanking", "False", "False"}); #line 66 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table105, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table108, "Given "); #line hidden - global::Reqnroll.Table table106 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table109 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 1", "Voucher"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 1", "AgencyBanking"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 2", "Safaricom"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 2", "Voucher"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 2", "PataPawa PostPay"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 2", "PataPawa PrePay"}); - table106.AddRow(new string[] { + table109.AddRow(new string[] { "Test Estate 2", "AgencyBanking"}); #line 79 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table106, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table109, "And "); #line hidden - global::Reqnroll.Table table107 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table110 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay", "PataPawa PrePay Contract"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 1", "AgencyBanking", "AgencyBanking Contract"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 2", "PataPawa PostPay", "PataPawa PostPay Contract"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 2", "PataPawa PrePay", "PataPawa PrePay Contract"}); - table107.AddRow(new string[] { + table110.AddRow(new string[] { "Test Estate 2", "AgencyBanking", "AgencyBanking Contract"}); #line 92 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table107, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table110, "Given "); #line hidden - global::Reqnroll.Table table108 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table111 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -442,7 +442,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -450,7 +450,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -458,7 +458,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract", @@ -466,7 +466,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Bill Pay (Post)", "", "BillPayment"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay", "PataPawa PrePay Contract", @@ -474,7 +474,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Bill Pay (Pre)", "", "BillPayment"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 1", "AgencyBanking", "AgencyBanking Contract", @@ -482,7 +482,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Balance Enquiry", "", "MobileTopup"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 1", "AgencyBanking", "AgencyBanking Contract", @@ -490,7 +490,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Deposit", "", "MobileTopup"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 1", "AgencyBanking", "AgencyBanking Contract", @@ -498,7 +498,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Withdrawal", "", "MobileTopup"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 1", "AgencyBanking", "AgencyBanking Contract", @@ -506,7 +506,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Mini Statement", "", "MobileTopup"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -514,7 +514,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract", @@ -522,7 +522,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 2", "PataPawa PostPay", "PataPawa PostPay Contract", @@ -530,7 +530,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Bill Pay (Post)", "", "BillPayment"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 2", "PataPawa PrePay", "PataPawa PrePay Contract", @@ -538,7 +538,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Bill Pay (Pre)", "", "BillPayment"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 2", "AgencyBanking", "AgencyBanking Contract", @@ -546,7 +546,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Balance Enquiry", "", "MobileTopup"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 2", "AgencyBanking", "AgencyBanking Contract", @@ -554,7 +554,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Deposit", "", "MobileTopup"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 2", "AgencyBanking", "AgencyBanking Contract", @@ -562,7 +562,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Withdrawal", "", "MobileTopup"}); - table108.AddRow(new string[] { + table111.AddRow(new string[] { "Test Estate 2", "AgencyBanking", "AgencyBanking Contract", @@ -571,9 +571,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "MobileTopup"}); #line 105 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table108, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table111, "When "); #line hidden - global::Reqnroll.Table table109 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table112 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -581,7 +581,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table109.AddRow(new string[] { + table112.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -589,7 +589,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Fixed", "Merchant Commission", "2.50"}); - table109.AddRow(new string[] { + table112.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", "PataPawa PostPay Contract", @@ -597,7 +597,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Percentage", "Merchant Commission", "0.50"}); - table109.AddRow(new string[] { + table112.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay", "PataPawa PrePay Contract", @@ -605,7 +605,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Percentage", "Merchant Commission", "0.50"}); - table109.AddRow(new string[] { + table112.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -613,7 +613,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Percentage", "Merchant Commission", "0.85"}); - table109.AddRow(new string[] { + table112.AddRow(new string[] { "Test Estate 2", "PataPawa PostPay", "PataPawa PostPay Contract", @@ -621,7 +621,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Percentage", "Merchant Commission", "0.50"}); - table109.AddRow(new string[] { + table112.AddRow(new string[] { "Test Estate 2", "PataPawa PrePay", "PataPawa PrePay Contract", @@ -630,9 +630,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Commission", "0.50"}); #line 124 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table109, "When "); + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table112, "When "); #line hidden - global::Reqnroll.Table table110 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table113 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -643,7 +643,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "EmailAddress", "EstateName", "EnableAgencyBanking"}); - table110.AddRow(new string[] { + table113.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -654,7 +654,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact1@merchant1.co.uk", "Test Estate 1", "True"}); - table110.AddRow(new string[] { + table113.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -665,7 +665,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact2@merchant2.co.uk", "Test Estate 1", "False"}); - table110.AddRow(new string[] { + table113.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -677,242 +677,242 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 2", "False"}); #line 133 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table110, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table113, "Given "); #line hidden - global::Reqnroll.Table table111 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table114 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "PataPawa PrePay", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "AgencyBanking", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 2", "00000001", "10000001", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "PataPawa PrePay", "Test Merchant 2", "00000001", "10000001", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "AgencyBanking", "Test Merchant 2", "00000001", "10000001", "Test Estate 1"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "PataPawa PostPay", "Test Merchant 3", "00000001", "10000001", "Test Estate 2"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "PataPawa PrePay", "Test Merchant 3", "00000001", "10000001", "Test Estate 2"}); - table111.AddRow(new string[] { + table114.AddRow(new string[] { "AgencyBanking", "Test Merchant 3", "00000001", "10000001", "Test Estate 2"}); #line 139 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table111, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table114, "Given "); #line hidden - global::Reqnroll.Table table112 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table115 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table112.AddRow(new string[] { + table115.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table112.AddRow(new string[] { + table115.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table112.AddRow(new string[] { + table115.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 2"}); #line 157 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table112, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table115, "Given "); #line hidden - global::Reqnroll.Table table113 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table116 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "PataPawa PostPay Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "PataPawa PrePay Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "AgencyBanking Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Hospital 1 Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "PataPawa PostPay Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "PataPawa PrePay Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "AgencyBanking Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Safaricom Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Hospital 1 Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "PataPawa PostPay Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "PataPawa PrePay Contract"}); - table113.AddRow(new string[] { + table116.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "AgencyBanking Contract"}); #line 163 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table113, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table116, "When "); #line hidden - global::Reqnroll.Table table114 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table117 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table114.AddRow(new string[] { + table117.AddRow(new string[] { "Deposit1", "365.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table114.AddRow(new string[] { + table117.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table114.AddRow(new string[] { + table117.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 3", "Test Estate 2"}); #line 181 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table114, "Given "); + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table117, "Given "); #line hidden - global::Reqnroll.Table table115 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table118 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName", "MerchantName"}); - table115.AddRow(new string[] { + table118.AddRow(new string[] { "merchantuser@testmerchant1.co.uk", "123456", "TestMerchant", "User1", "Test Estate 1", "Test Merchant 1"}); - table115.AddRow(new string[] { + table118.AddRow(new string[] { "merchantuser@testmerchant2.co.uk", "123456", "TestMerchant", "User2", "Test Estate 1", "Test Merchant 2"}); - table115.AddRow(new string[] { + table118.AddRow(new string[] { "merchantuser@testmerchant3.co.uk", "123456", "TestMerchant", @@ -920,7 +920,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 2", "Test Merchant 3"}); #line 187 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table115, "Given "); + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table118, "Given "); #line hidden } @@ -959,7 +959,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table116 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table119 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -978,7 +978,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "AccountNumber", "CustomerName", "MeterNumber"}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "1", "Sale", @@ -997,7 +997,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "4", "Sale", @@ -1016,7 +1016,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "5", "Sale", @@ -1035,7 +1035,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", ""}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "8", "Sale", @@ -1054,7 +1054,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "12345678", "", ""}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "9", "Sale", @@ -1073,7 +1073,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "12345678", "Mr Test Customer", ""}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "10", "Sale", @@ -1092,7 +1092,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "", "00000001"}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "11", "Sale", @@ -1111,7 +1111,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "00000001", "Customer 1", "00000001"}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "12", "Sale", @@ -1130,7 +1130,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "12345678", "", ""}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "13", "Sale", @@ -1149,7 +1149,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "12345678", "", ""}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "14", "Sale", @@ -1168,7 +1168,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "12345678", "", ""}); - table116.AddRow(new string[] { + table119.AddRow(new string[] { "Today", "15", "Sale", @@ -1188,14 +1188,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", ""}); #line 196 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table116, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table119, "When "); #line hidden #line 211 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant2.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 2\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table117 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table120 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1210,7 +1210,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ProductName", "RecipientEmail", "RecipientMobile"}); - table117.AddRow(new string[] { + table120.AddRow(new string[] { "Today", "2", "Sale", @@ -1225,7 +1225,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); - table117.AddRow(new string[] { + table120.AddRow(new string[] { "Today", "6", "Sale", @@ -1241,14 +1241,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "123456789"}); #line 212 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table117, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table120, "When "); #line hidden #line 217 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant3.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 3\" for Estate \"Test Estate 2\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table118 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table121 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -1263,7 +1263,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ProductName", "RecipientEmail", "RecipientMobile"}); - table118.AddRow(new string[] { + table121.AddRow(new string[] { "Today", "3", "Sale", @@ -1278,7 +1278,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); - table118.AddRow(new string[] { + table121.AddRow(new string[] { "Today", "7", "Sale", @@ -1294,58 +1294,58 @@ await testRunner.GivenAsync("I have a token to access the estate management and "test@recipient.co.uk", ""}); #line 218 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table118, "When "); + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table121, "When "); #line hidden - global::Reqnroll.Table table119 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table122 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "TransactionNumber", "TransactionType", "ResponseCode", "ResponseMessage"}); - table119.AddRow(new string[] { + table122.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "1", "Sale", "0000", "SUCCESS"}); - table119.AddRow(new string[] { + table122.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "2", "Sale", "0000", "SUCCESS"}); - table119.AddRow(new string[] { + table122.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "3", "Sale", "0000", "SUCCESS"}); - table119.AddRow(new string[] { + table122.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "4", "Sale", "0000", "SUCCESS"}); - table119.AddRow(new string[] { + table122.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "5", "Sale", "0000", "SUCCESS"}); - table119.AddRow(new string[] { + table122.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "6", "Sale", "0000", "SUCCESS"}); - table119.AddRow(new string[] { + table122.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "7", @@ -1353,7 +1353,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0000", "SUCCESS"}); #line 223 - await testRunner.ThenAsync("the sale transaction response should contain the following information", ((string)(null)), table119, "Then "); + await testRunner.ThenAsync("the sale transaction response should contain the following information", ((string)(null)), table122, "Then "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/TransactionProcessorACL.IntegrationTests/Shared/ACLSteps.cs b/TransactionProcessorACL.IntegrationTests/Shared/ACLSteps.cs index c6824d0..7eb5370 100644 --- a/TransactionProcessorACL.IntegrationTests/Shared/ACLSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Shared/ACLSteps.cs @@ -52,7 +52,7 @@ public async Task SendAclSaleRequestMessage((EstateDetails, String, Guid, String CancellationToken cancellationToken) { String uri = "api/saletransactions"; - await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, cancellationToken); + await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, "Sale", cancellationToken); } public async Task SendAclLogonRequestMessage((EstateDetails, String, Guid, String, LogonTransactionRequestMessage) requestMessage, @@ -60,7 +60,7 @@ public async Task SendAclLogonRequestMessage((EstateDetails, String, Guid, Strin { String uri = "api/logontransactions"; - await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, cancellationToken); + await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, "Logon", cancellationToken); } public async Task SendAclReconciliationRequestMessage((EstateDetails, String, Guid, String, ReconciliationRequestMessage) requestMessage, @@ -68,7 +68,7 @@ public async Task SendAclReconciliationRequestMessage((EstateDetails, String, Gu { String uri = "api/reconciliationtransactions"; - await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, cancellationToken); + await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, "Reconciliation", cancellationToken); } private async Task SendAclRequestMessage(String uri, @@ -77,6 +77,7 @@ private async Task SendAclRequestMessage(String uri, Guid merchantId, EstateDetails estateDetails, String transactionNumber, + String expectedTransactionType, CancellationToken cancellationToken) { StringContent content = new StringContent(StringSerialiser.Serialise(request), Encoding.UTF8, @@ -92,6 +93,11 @@ private async Task SendAclRequestMessage(String uri, TransactionResponse transactionResponse = StringSerialiser.Deserialise(responseContent); + TransactionResponseAssertions.Verify(transactionResponse, + estateDetails.EstateId, + merchantId, + expectedTransactionType); + estateDetails.AddTransactionResponse(merchantId, transactionNumber, transactionResponse); } @@ -139,7 +145,7 @@ public async Task WhenIRedeemTheVoucherForEstateAndMerchantTransactionNumberTheV TransactionResponse transactionResponse = es1.EstateDetails.GetTransactionResponse(merchantId, transactionNumber.ToString()); GetVoucherResponse voucher = null; - await Retry.For(async () => { + await Retry.ForEventually(async () => { Result voucherResult = await this.TransactionProcessorClient.GetVoucherByTransactionId(accessToken, es1.EstateDetails.EstateId, @@ -222,7 +228,7 @@ public async Task WhenIGetTheMerchantContractInformationForMerchantForEstateTheR this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", userAccessToken); - await Retry.For(async () => { + await Retry.ForEventually(async () => { HttpResponseMessage response = await this.HttpClient.GetAsync(uri, CancellationToken.None); response.IsSuccessStatusCode.ShouldBeTrue(); @@ -261,7 +267,7 @@ public async Task WhenIGetTheMerchantDailyPerformanceSummaryForMerchantForEstate }; - await Retry.For(async () => { + await Retry.ForEventually(async () => { StringContent content = new(StringSerialiser.Serialise(request), Encoding.UTF8, "application/json"); HttpResponseMessage response = await this.HttpClient.PostAsync(uri, content, cancellationToken).ConfigureAwait(false); @@ -321,7 +327,7 @@ public async Task WhenIGetTheMerchantTransactionMixSummaryForMerchantForEstate(S TopN = 5, }; - await Retry.For(async () => { + await Retry.ForEventually(async () => { StringContent content = new(StringSerialiser.Serialise(request), Encoding.UTF8, "application/json"); HttpResponseMessage response = await this.HttpClient.PostAsync(uri, content, cancellationToken).ConfigureAwait(false); @@ -367,7 +373,7 @@ public async Task WhenIGetTheRecentActivityReceiptSearchForMerchantForEstate(Str PageSize = pageSize }; - await Retry.For(async () => { + await Retry.ForEventually(async () => { StringContent content = new(StringSerialiser.Serialise(request), Encoding.UTF8, "application/json"); HttpResponseMessage response = await this.HttpClient.PostAsync(uri, content, cancellationToken).ConfigureAwait(false); diff --git a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs index 3ff4025..367d9e2 100644 --- a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs @@ -94,7 +94,7 @@ public async Task GivenIAmLoggedInAsWithPasswordForMerchantForEstateWithClient(S Guid merchantId = estateDetails.EstateDetails.GetMerchantId(merchantName); ClientDetails clientDetails = this.TestingContext.GetClientDetails(clientId); string? accessToken = null; - await Retry.For(async () => { + await Retry.ForEventually(async () => { Result tokenResponseResult = await this.TestingContext.DockerHelper.SecurityServiceClient .GetToken(username, password, clientId, clientDetails.ClientSecret, CancellationToken.None).ConfigureAwait(false); tokenResponseResult.IsSuccess.ShouldBeTrue($"Failed to get merchant user token for '{username}' using client '{clientId}': {tokenResponseResult.Message}"); @@ -205,7 +205,7 @@ public async Task GivenIMakeTheFollowingManualMerchantDeposits(DataTable table){ await this.TransactionProcessorSteps.GivenIMakeTheFollowingManualMerchantDeposits(this.TestingContext.AccessToken, request); - await Retry.For(async () => { + await Retry.ForEventually(async () => { Decimal currentMerchantBalance = await this.GetMerchantBalance(request.Item2); currentMerchantBalance.ShouldBe(previousMerchantBalance + request.Item3.Amount); @@ -325,7 +325,8 @@ public async Task WhenICreateTheFollowingEstates(DataTable table){ public async Task WhenICreateTheFollowingMerchants(DataTable table){ List estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); List<(EstateDetails estate, CreateMerchantRequest, Boolean EnableAgencyBanking)> requests = table.Rows.ToCreateMerchantRequests(estates); - List verifiedMerchants = await this.TransactionProcessorSteps.WhenICreateTheFollowingMerchants(this.TestingContext.AccessToken, requests); + List verifiedMerchants = + await this.TransactionProcessorSteps.WhenICreateTheFollowingMerchants(this.TestingContext.AccessToken, requests); foreach (TransactionProcessor.DataTransferObjects.Responses.Merchant.MerchantResponse verifiedMerchant in verifiedMerchants){ EstateDetails1 estateDetails = this.TestingContext.GetEstateDetails(verifiedMerchant.EstateId); @@ -389,6 +390,24 @@ public async Task WhenICreateTheFollowingSecurityUsers(DataTable table){ var estates = this.TestingContext.Estates.Select(e => e.EstateDetails).ToList(); List createUserRequests = table.Rows.ToCreateNewUserRequests(estates); await this.TransactionProcessorSteps.WhenICreateTheFollowingSecurityUsers(this.TestingContext.AccessToken, createUserRequests, estates); + + foreach (CreateNewUserRequest request in createUserRequests) + { + await Retry.ForEventually(async () => { + Result> usersResult = + await this.TestingContext.DockerHelper.SecurityServiceClient.GetUsers( + this.TestingContext.DockerHelper.AccessToken, + request.EmailAddress, + CancellationToken.None); + + usersResult.IsSuccess.ShouldBeTrue(usersResult.Message); + UserResponse user = usersResult.Data.ShouldHaveSingleItem(); + user.EmailAddress.ShouldBe(request.EmailAddress); + user.GivenName.ShouldBe(request.GivenName); + user.MiddleName.ShouldBe(request.MiddleName); + user.FamilyName.ShouldBe(request.FamilyName); + }); + } } [Given(@"I have created the following security users for voucher redemption")] @@ -568,6 +587,12 @@ public async Task GivenIInitialiseTheAgencyBankingHost() var result = await this.TestingContext.DockerHelper.AgencyBankingClient.InitializeSystem(request, CancellationToken.None); result.IsSuccess.ShouldBeTrue("Error initializing Agency Banking Host"); + await Retry.ForEventually(async () => { + Result configurationResult = + await this.TestingContext.DockerHelper.AgencyBankingClient.GetSystemConfiguration(CancellationToken.None); + configurationResult.IsSuccess.ShouldBeTrue(configurationResult.Message); + AgencyBankingAssertions.VerifySystemConfiguration(configurationResult.Data, request); + }); } [Given("I create the following accounts")] @@ -585,6 +610,13 @@ public async Task GivenICreateTheFollowingAccounts(DataTable dataTable) }; Result result = await this.TestingContext.DockerHelper.AgencyBankingClient.CreateGlAccount(request, CancellationToken.None); result.IsSuccess.ShouldBeTrue($"Error creating GL account {request.GlCode}"); + + await Retry.ForEventually(async () => { + Result accountResult = + await this.TestingContext.DockerHelper.AgencyBankingClient.GetGlAccountByCode(request.GlCode, CancellationToken.None); + accountResult.IsSuccess.ShouldBeTrue(accountResult.Message); + AgencyBankingAssertions.VerifyGlAccount(accountResult.Data, request); + }); } } @@ -604,6 +636,13 @@ public async Task GivenICreateTheFollowingCustomers(DataTable dataTable) }; Result result = await this.TestingContext.DockerHelper.AgencyBankingClient.CreateCustomer(request, CancellationToken.None); result.IsSuccess.ShouldBeTrue($"Error creating customer {request.AccountNumber}"); + + await Retry.ForEventually(async () => { + Result customerResult = + await this.TestingContext.DockerHelper.AgencyBankingClient.GetCustomerByAccountNumber(request.AccountNumber, CancellationToken.None); + customerResult.IsSuccess.ShouldBeTrue(customerResult.Message); + AgencyBankingAssertions.VerifyCustomer(customerResult.Data, request); + }); } } @@ -621,6 +660,13 @@ public async Task GivenICreateTheSettlementAccount(DataTable dataTable) }; Result result = await this.TestingContext.DockerHelper.AgencyBankingClient.CreateSettlementAccount(request, CancellationToken.None); result.IsSuccess.ShouldBeTrue($"Error creating settlement account {request.AccountNumber}"); + + await Retry.ForEventually(async () => { + Result accountResult = + await this.TestingContext.DockerHelper.AgencyBankingClient.GetSettlementAccountByNumber(request.AccountNumber, CancellationToken.None); + accountResult.IsSuccess.ShouldBeTrue(accountResult.Message); + AgencyBankingAssertions.VerifySettlementAccount(accountResult.Data, request); + }); } } diff --git a/TransactionProcessorACL/Bootstrapper/MiddlewareRegistry.cs b/TransactionProcessorACL/Bootstrapper/MiddlewareRegistry.cs index a24fe87..e67550b 100644 --- a/TransactionProcessorACL/Bootstrapper/MiddlewareRegistry.cs +++ b/TransactionProcessorACL/Bootstrapper/MiddlewareRegistry.cs @@ -30,6 +30,7 @@ public MiddlewareRegistry() this.ConfigureHealthChecks(); this.ConfigureAuthentication(); this.ConfigurePasswordTokenHandling(); + this.AddSingleton(); this.ConfigureJsonOptions(); this.ConfigureControllers(); this.AddHealthMonitoringRegistration(Startup.Configuration); diff --git a/TransactionProcessorACL/Middleware/AuthorizationFailureDiagnosticsHandler.cs b/TransactionProcessorACL/Middleware/AuthorizationFailureDiagnosticsHandler.cs new file mode 100644 index 0000000..7b88649 --- /dev/null +++ b/TransactionProcessorACL/Middleware/AuthorizationFailureDiagnosticsHandler.cs @@ -0,0 +1,49 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authorization.Policy; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; + +namespace TransactionProcessorACL.Middleware; + +/// +/// Temporary diagnostics for authorization failures. This logs policy metadata only. +/// +public sealed class AuthorizationFailureDiagnosticsHandler : IAuthorizationMiddlewareResultHandler +{ + private readonly AuthorizationMiddlewareResultHandler InnerHandler = new(); + private readonly ILogger Logger; + + public AuthorizationFailureDiagnosticsHandler(ILogger logger) + { + this.Logger = logger; + } + + public async Task HandleAsync(RequestDelegate next, + HttpContext context, + AuthorizationPolicy policy, + PolicyAuthorizationResult authorizeResult) + { + if (authorizeResult.Succeeded == false) + { + string policyRequirements = String.Join(", ", policy.Requirements.Select(requirement => requirement.GetType().FullName)); + string failedRequirements = authorizeResult.AuthorizationFailure == null + ? String.Empty + : String.Join(", ", authorizeResult.AuthorizationFailure.FailedRequirements.Select(requirement => requirement.GetType().FullName)); + string failureReasons = authorizeResult.AuthorizationFailure == null + ? String.Empty + : String.Join("; ", authorizeResult.AuthorizationFailure.FailureReasons.Select(reason => reason.Message)); + + this.Logger.LogWarning("Authorization failure diagnostics: Method={Method}; Path={Path}; Requirements={Requirements}; FailedRequirements={FailedRequirements}; FailureReasons={FailureReasons}", + context.Request.Method, + context.Request.Path, + policyRequirements, + failedRequirements, + failureReasons); + } + + await this.InnerHandler.HandleAsync(next, context, policy, authorizeResult).ConfigureAwait(false); + } +} diff --git a/TransactionProcessorACL/Startup.cs b/TransactionProcessorACL/Startup.cs index 5809d54..695393d 100644 --- a/TransactionProcessorACL/Startup.cs +++ b/TransactionProcessorACL/Startup.cs @@ -5,6 +5,8 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using TransactionProcessorACL.Endpoints; +using System.Linq; +using Microsoft.AspNetCore.Authorization; namespace TransactionProcessorACL { @@ -93,6 +95,29 @@ private static void ConfigureMiddleware(IApplicationBuilder app) app.AddExceptionHandler(); app.UseRouting(); app.UseAuthentication(); + app.Use(async (context, next) => + { + if (context.Request.Path.StartsWithSegments("/api/reporting") && + context.User.Identity?.IsAuthenticated == true) + { + ILogger logger = context.RequestServices.GetRequiredService() + .CreateLogger("TransactionProcessorACL.AuthenticationDiagnostics"); + + String claims = String.Join("; ", context.User.Claims.Select(claim => $"{claim.Type}={claim.Value}")); + String authorizationMetadata = String.Join(", ", context.GetEndpoint()?.Metadata + .GetOrderedMetadata() + .Select(metadata => $"Policy={metadata.Policy ?? ""}; Roles={metadata.Roles ?? ""}") + ?? Enumerable.Empty()); + logger.LogWarning("Temporary authentication diagnostics: AuthenticationType={AuthenticationType}; Claims={Claims}", + context.User.Identity.AuthenticationType, + claims); + logger.LogWarning("Temporary endpoint authorization diagnostics: Endpoint={Endpoint}; Metadata={Metadata}", + context.GetEndpoint()?.DisplayName, + authorizationMetadata); + } + + await next(); + }); app.UseAuthorization(); app.UseMiddleware(); app.UseMiddleware(); From 3a359cc2493ff319ac235e27cf1210fa453d3d58 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Wed, 14 Oct 2026 13:19:24 +0100 Subject: [PATCH 5/6] nightly fixes --- ...tionProcessorACLApplicationServiceTests.cs | 12 +- .../BackendAPI/DataTransferObjects/Class1.cs | 8 +- .../RecentActivityReceiptSearch.cs | 13 +- ...ansactionProcessorACLApplicationService.cs | 14 +- .../Common/DockerHelper.cs | 66 +++- .../Common/GenericSteps.cs | 2 +- .../Common/TransactionResponseAssertions.cs | 4 +- .../TransactionResponseAssertionsTests.cs | 5 +- .../Reporting/Reporting.feature | 18 +- .../Reporting/Reporting.feature.cs | 311 ++++++++++-------- .../Shared/ACLSteps.cs | 19 +- .../Shared/SharedSteps.cs | 6 +- .../Bootstrapper/MediatorRegistry.cs | 4 +- .../Bootstrapper/MiddlewareRegistry.cs | 3 +- .../AuthorizationFailureDiagnosticsHandler.cs | 49 --- TransactionProcessorACL/Startup.cs | 25 -- 16 files changed, 303 insertions(+), 256 deletions(-) delete mode 100644 TransactionProcessorACL/Middleware/AuthorizationFailureDiagnosticsHandler.cs diff --git a/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACLApplicationServiceTests.cs b/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACLApplicationServiceTests.cs index 29abb8d..2034ffc 100644 --- a/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACLApplicationServiceTests.cs +++ b/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACLApplicationServiceTests.cs @@ -767,9 +767,13 @@ public async Task TransactionProcessorACLApplicationService_GetRecentActivityRec .ReturnsAsync(Result.Success(new TransactionProcessorACL.BusinessLogic.BackendAPI.DataTransferObjects.RecentActivityReceiptSearchResponse { ReportDate = new DateTime(2026, 7, 8), - PageNumber = 2, - PageSize = 5, - TotalCount = 1, + Pagination = new TransactionProcessorACL.BusinessLogic.BackendAPI.DataTransferObjects.PaginationMetadata + { + PageNumber = 2, + PageSize = 5, + TotalItems = 1, + TotalPages = 1 + }, Items = [ new TransactionProcessorACL.BusinessLogic.BackendAPI.DataTransferObjects.RecentActivityReceiptSearchItem @@ -805,7 +809,7 @@ public async Task TransactionProcessorACLApplicationService_GetRecentActivityRec result.Data.Items[0].ReceiptReference.ShouldBe("RCPT-1"); capturedRequest.ShouldNotBeNull(); capturedRequest.MerchantReportingId.ShouldBe(12345); - capturedRequest.ReportDate.ShouldBe(new DateTime(2026, 7, 8)); + capturedRequest.ReportDate.ShouldBe(new DateOnly(2026, 7, 8)); capturedRequest.SearchText.ShouldBe("abc"); capturedRequest.PageNumber.ShouldBe(2); capturedRequest.PageSize.ShouldBe(5); diff --git a/TransactionProcessorACL.BusinessLogic/BackendAPI/DataTransferObjects/Class1.cs b/TransactionProcessorACL.BusinessLogic/BackendAPI/DataTransferObjects/Class1.cs index f49f6a0..bd17f07 100644 --- a/TransactionProcessorACL.BusinessLogic/BackendAPI/DataTransferObjects/Class1.cs +++ b/TransactionProcessorACL.BusinessLogic/BackendAPI/DataTransferObjects/Class1.cs @@ -65,8 +65,8 @@ public enum TransactionMixMeasure public class TransactionMixSummaryRequest { public int? MerchantReportingId { get; set; } - public DateTime StartDate { get; set; } - public DateTime EndDate { get; set; } + public DateOnly StartDate { get; set; } + public DateOnly EndDate { get; set; } public TransactionMixBreakdown Breakdown { get; set; } public TransactionMixMeasure Measure { get; set; } public int TopN { get; set; } = 5; @@ -75,8 +75,8 @@ public class TransactionMixSummaryRequest public class MerchantDailyPerformanceSummaryRequest { public Int32 MerchantReportingId { get; set; } - public DateTime StartDate { get; set; } - public DateTime EndDate { get; set; } + public DateOnly StartDate { get; set; } + public DateOnly EndDate { get; set; } } public sealed class MerchantDailyPerformanceSummaryResponse diff --git a/TransactionProcessorACL.BusinessLogic/BackendAPI/DataTransferObjects/RecentActivityReceiptSearch.cs b/TransactionProcessorACL.BusinessLogic/BackendAPI/DataTransferObjects/RecentActivityReceiptSearch.cs index d92da7f..2859590 100644 --- a/TransactionProcessorACL.BusinessLogic/BackendAPI/DataTransferObjects/RecentActivityReceiptSearch.cs +++ b/TransactionProcessorACL.BusinessLogic/BackendAPI/DataTransferObjects/RecentActivityReceiptSearch.cs @@ -9,7 +9,7 @@ public class RecentActivityReceiptSearchRequest public int? MerchantReportingId { get; set; } - public DateTime ReportDate { get; set; } + public DateOnly ReportDate { get; set; } public string? SearchText { get; set; } @@ -22,13 +22,20 @@ public class RecentActivityReceiptSearchResponse { public DateTime ReportDate { get; set; } + public PaginationMetadata Pagination { get; set; } = new(); + + public List Items { get; set; } = []; +} + +public class PaginationMetadata +{ public int PageNumber { get; set; } public int PageSize { get; set; } - public int TotalCount { get; set; } + public int TotalItems { get; set; } - public List Items { get; set; } = []; + public int TotalPages { get; set; } } public class RecentActivityReceiptSearchItem diff --git a/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs b/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs index d851ade..2aae528 100644 --- a/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs +++ b/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs @@ -420,7 +420,7 @@ public async Task> GetMerchantDa return ResultHelpers.CreateFailure(accessTokenResult); } - BackendAPI.DataTransferObjects.MerchantDailyPerformanceSummaryRequest apiRequest = new BackendAPI.DataTransferObjects.MerchantDailyPerformanceSummaryRequest { StartDate = request.StartDate, EndDate = request.EndDate, MerchantReportingId = request.MerchantReportingId }; + BackendAPI.DataTransferObjects.MerchantDailyPerformanceSummaryRequest apiRequest = new BackendAPI.DataTransferObjects.MerchantDailyPerformanceSummaryRequest { StartDate = DateOnly.FromDateTime(request.StartDate), EndDate = DateOnly.FromDateTime(request.EndDate), MerchantReportingId = request.MerchantReportingId }; TokenResponse accessToken = accessTokenResult.Data; Result apiResponse = await this.EstateReportingApiClient.GetMerchantDailyPerformanceSummary(accessToken.AccessToken, estateId, apiRequest, cancellationToken); @@ -452,8 +452,8 @@ public async Task> GetMerchantTran } var apiRequest = new BackendAPI.DataTransferObjects.TransactionMixSummaryRequest { - StartDate = request.StartDate, - EndDate = request.EndDate, + StartDate = DateOnly.FromDateTime(request.StartDate), + EndDate = DateOnly.FromDateTime(request.EndDate), Breakdown = Enum.Parse(request.Breakdown.ToString()), Measure = Enum.Parse(request.Measure.ToString()), MerchantReportingId = request.MerchantReportingId, @@ -501,7 +501,7 @@ public async Task> GetRecentActivity var apiRequest = new BackendAPI.DataTransferObjects.RecentActivityReceiptSearchRequest { MerchantReportingId = request.MerchantReportingId, - ReportDate = request.ReportDate.Date, + ReportDate = DateOnly.FromDateTime(request.ReportDate.Date), SearchText = string.IsNullOrWhiteSpace(request.SearchText) ? null : request.SearchText.Trim(), PageNumber = request.PageNumber, PageSize = request.PageSize @@ -516,9 +516,9 @@ public async Task> GetRecentActivity RecentActivityReceiptSearchResponse response = new() { ReportDate = apiResponse.Data.ReportDate, - PageNumber = apiResponse.Data.PageNumber, - PageSize = apiResponse.Data.PageSize, - TotalCount = apiResponse.Data.TotalCount, + PageNumber = apiResponse.Data.Pagination.PageNumber, + PageSize = apiResponse.Data.Pagination.PageSize, + TotalCount = apiResponse.Data.Pagination.TotalItems, Items = apiResponse.Data.Items.Select(i => new RecentActivityReceiptSearchItem { Amount = i.Amount, diff --git a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs index 1fdd74a..99c928c 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs @@ -1,16 +1,18 @@ -using EventStore.Client; +using DotNet.Testcontainers.Builders; +using EventStore.Client; using Shared.IntegrationTesting; using System.Linq; -using DotNet.Testcontainers.Builders; namespace TransactionProcessor.IntegrationTests.Common { using Client; using SecurityService.Client; + using Shared.IntegrationTesting.TestContainers; using Shared.Serialisation; using System; using System.Collections.Generic; using System.Diagnostics; + using System.IO; using System.Net.Http; using System.Threading; using System.Threading.Tasks; @@ -68,6 +70,56 @@ public DockerHelper() #region Methods + public override ContainerBuilder SetupEventStoreContainer() + { + this.Trace("About to Start Event Store Container"); + + Dictionary environmentVariables = new(){ + {"EVENTSTORE_RUN_PROJECTIONS","all"}, + {"EVENTSTORE_START_STANDARD_PROJECTIONS","true"}, + {"EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP","true"}, + {"EVENTSTORE_PROJECTION_EXECUTION_TIMEOUT","5000"}, + {"KURRENTDB_PREPARE_TIMEOUT_MS","30000"}, + {"KURRENTDB_COMMIT_TIMEOUT_MS","30000"}, + }; + ContainerBuilder eventStoreContainer = new ContainerBuilder(); + + if (!this.IsSecureEventStore) + { + environmentVariables.Add("EVENTSTORE_INSECURE", "true"); + } + else + { + String certsPath = "/etc/eventstore/certs"; + + // Copy these to the container + String path = Path.Combine(Directory.GetCurrentDirectory(), "certs"); + + eventStoreContainer = eventStoreContainer.MountHostFolder(path, certsPath); + + // Certificates configuration + environmentVariables.Add("EVENTSTORE_CertificateFile", $"{certsPath}/node1/node.crt"); + environmentVariables.Add("EVENTSTORE_CertificatePrivateKeyFile", $"{certsPath}/node1/node.key"); + environmentVariables.Add("EVENTSTORE_TrustedRootCertificatesPath", $"{certsPath}/ca"); + environmentVariables.Add("EVENTSTORE_INSECURE", "false"); + } + + String logfilePath = "/var/log/kurrentdb"; + eventStoreContainer = eventStoreContainer.MountHostFolder(this.HostTraceFolder, logfilePath); + + (String imageName, Boolean useLatest) imageDetails = this.GetImageDetails(ContainerType.EventStore).Data; + this.Trace($"About to Start Event Store Container using image [{imageDetails.imageName}]"); + + + + eventStoreContainer = eventStoreContainer.WithName(this.EventStoreContainerName) // similar to WithName() + .WithImage(imageDetails.imageName) + .WithEnvironment(environmentVariables) + .WithPortBinding(DockerPorts.EventStoreHttpDockerPort, true); + + return eventStoreContainer; + } + public override DotNet.Testcontainers.Builders.ContainerBuilder SetupEstateReportingContainer() { Dictionary environmentVariables = new(); @@ -90,13 +142,19 @@ public override DotNet.Testcontainers.Builders.ContainerBuilder SetupEstateRepor public override ContainerBuilder SetupTransactionProcessorContainer() { Dictionary additionalVariables = new(); - additionalVariables.Add("OperatorConfiguration:AgencyBanking:Url", $"http://{this.TestHostContainerName}:{DockerPorts.TestHostPort}/api/agencybanking"); - + additionalVariables.Add("OperatorConfiguration:AgencyBanking:Url", $"http://{this.TestHostContainerName}:{DockerPorts.TestHostPort}/api/agencybanking"); this.AdditionalVariables.Add(ContainerType.TransactionProcessor, additionalVariables); return base.SetupTransactionProcessorContainer(); } + protected override String GenerateEventStoreConnectionString(String userName = "admin", String password = "changeit") + { + String eventStoreAddress = $"esdb://{userName}:{password}@{this.EventStoreContainerName}:{DockerPorts.EventStoreHttpDockerPort}?tls=false&defaultDeadline=240000"; + + return eventStoreAddress; + } + public override async Task CreateSubscriptions(CancellationToken cancellationToken){ List<(String streamName, String groupName, Int32 maxRetries)> subscriptions = new List<(String streamName, String groupName, Int32 maxRetries)>(); subscriptions.AddRange(MessagingService.IntegrationTesting.Helpers.SubscriptionsHelper.GetSubscriptions()); diff --git a/TransactionProcessorACL.IntegrationTests/Common/GenericSteps.cs b/TransactionProcessorACL.IntegrationTests/Common/GenericSteps.cs index 56a188d..55669fa 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/GenericSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/GenericSteps.cs @@ -52,7 +52,7 @@ public async Task StartSystem() this.TestingContext.DockerHelper.DockerCredentials = Setup.DockerCredentials; this.TestingContext.DockerHelper.SqlCredentials = Setup.SqlCredentials; this.TestingContext.DockerHelper.SqlServerContainerName = "sharedsqlserver"; - + this.TestingContext.DockerHelper.SetImageDetails(ContainerType.TransactionProcessorAcl, ("transactionprocessoracl", false)); this.TestingContext.DockerHelper.SetImageDetails(ContainerType.EstateReporting , ("stuartferguson/estatereportingapi:master", true)); diff --git a/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertions.cs b/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertions.cs index 0313449..99dd558 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertions.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertions.cs @@ -8,13 +8,11 @@ public static class TransactionResponseAssertions { public static void Verify(TransactionResponse response, Guid expectedEstateId, - Guid expectedMerchantId, - string expectedTransactionType) + Guid expectedMerchantId) { response.ShouldNotBeNull(); response.TransactionId.ShouldNotBe(Guid.Empty); response.EstateId.ShouldBe(expectedEstateId); response.MerchantId.ShouldBe(expectedMerchantId); - response.TransactionType.ShouldBe(expectedTransactionType); } } diff --git a/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertionsTests.cs b/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertionsTests.cs index 36326ad..8e4c0c5 100644 --- a/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertionsTests.cs +++ b/TransactionProcessorACL.IntegrationTests/Common/TransactionResponseAssertionsTests.cs @@ -16,11 +16,10 @@ public void Verify_rejects_a_response_for_the_wrong_merchant() { EstateId = estateId, MerchantId = Guid.NewGuid(), - TransactionId = Guid.NewGuid(), - TransactionType = "Sale" + TransactionId = Guid.NewGuid() }; Assert.Throws(() => - TransactionResponseAssertions.Verify(response, estateId, requestedMerchantId, "Sale")); + TransactionResponseAssertions.Verify(response, estateId, requestedMerchantId)); } } diff --git a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature index 542e6bf..ef17203 100644 --- a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature +++ b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature @@ -28,6 +28,20 @@ Background: | ClientId | | serviceClient | + Given the following bills are available at the PataPawa PostPaid Host + | AccountNumber | AccountName | DueDate | Amount | + | 12345678 | Test Account 1 | Today | 100.00 | + + Given the following users are available at the PataPawa PrePay Host + | Username | Password | + | operatora | 1234567898 | + + Given the following meters are available at the PataPawa PrePay Host + | MeterNumber | CustomerName | + | 00000001 | Customer 1 | + | 00000002 | Customer 2 | + | 00000003 | Customer 3 | + Given I have created the following estates | EstateName | | Test Estate 1 | @@ -144,8 +158,8 @@ Scenario: Recent activity receipt search supports paging | Today | 1009 | Sale | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 18.00 | 123456789 | test9@customer.co.uk | Safaricom Contract | Variable Topup | | | | Today | 1010 | Sale | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 19.00 | 123456789 | test10@customer.co.uk | Safaricom Contract | Variable Topup | | | - When I get the recent activity receipt search for Merchant "Test Merchant 1" for Estate "Test Estate 1" page 1 size 5 + When I get the recent activity receipt search for Merchant "Test Merchant 1" for Estate "Test Estate 1" page 1 size 5 expecting total count 10 Then the recent activity receipt search response for page 1 should contain 5 items and total count 10 - When I get the recent activity receipt search for Merchant "Test Merchant 1" for Estate "Test Estate 1" page 2 size 5 + When I get the recent activity receipt search for Merchant "Test Merchant 1" for Estate "Test Estate 1" page 2 size 5 expecting total count 10 Then the recent activity receipt search response for page 2 should contain 5 items and total count 10 diff --git a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs index c66f2c1..67c275e 100644 --- a/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs +++ b/TransactionProcessorACL.IntegrationTests/Reporting/Reporting.feature.cs @@ -113,167 +113,204 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table76 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table1 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table76.AddRow(new string[] { + table1.AddRow(new string[] { "Merchant"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table76, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table1, "Given "); #line hidden - global::Reqnroll.Table table77 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table2 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table77.AddRow(new string[] { + table2.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table77.AddRow(new string[] { + table2.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST Scope", "A scope for Transaction Processor ACL REST"}); - table77.AddRow(new string[] { + table2.AddRow(new string[] { "estateReporting", "Estate Reporting REST Scope", "Scope for Estate Reporting REST"}); #line 10 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table77, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table2, "Given "); #line hidden - global::Reqnroll.Table table78 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table3 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table78.AddRow(new string[] { + table3.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); - table78.AddRow(new string[] { + table3.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST", "Secret1", "transactionProcessorACL", "merchantId, estateId, role"}); - table78.AddRow(new string[] { + table3.AddRow(new string[] { "estateReporting", "Estate Reporting REST", "Secret1", "estateReporting", "merchantId,estateId,role"}); #line 16 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table78, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table3, "Given "); #line hidden - global::Reqnroll.Table table79 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table4 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table79.AddRow(new string[] { + table4.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor,transactionProcessorACL, estateReporting", "client_credentials"}); - table79.AddRow(new string[] { + table4.AddRow(new string[] { "merchantClient", "Merchant Client", "Secret1", "transactionProcessorACL", "password"}); #line 22 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table79, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table4, "Given "); #line hidden - global::Reqnroll.Table table80 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table5 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table80.AddRow(new string[] { + table5.AddRow(new string[] { "serviceClient"}); #line 27 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor acl reso" + - "urces", ((string)(null)), table80, "Given "); + "urces", ((string)(null)), table5, "Given "); +#line hidden + global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { + "AccountNumber", + "AccountName", + "DueDate", + "Amount"}); + table6.AddRow(new string[] { + "12345678", + "Test Account 1", + "Today", + "100.00"}); +#line 31 + await testRunner.GivenAsync("the following bills are available at the PataPawa PostPaid Host", ((string)(null)), table6, "Given "); +#line hidden + global::Reqnroll.Table table7 = new global::Reqnroll.Table(new string[] { + "Username", + "Password"}); + table7.AddRow(new string[] { + "operatora", + "1234567898"}); +#line 35 + await testRunner.GivenAsync("the following users are available at the PataPawa PrePay Host", ((string)(null)), table7, "Given "); +#line hidden + global::Reqnroll.Table table8 = new global::Reqnroll.Table(new string[] { + "MeterNumber", + "CustomerName"}); + table8.AddRow(new string[] { + "00000001", + "Customer 1"}); + table8.AddRow(new string[] { + "00000002", + "Customer 2"}); + table8.AddRow(new string[] { + "00000003", + "Customer 3"}); +#line 39 + await testRunner.GivenAsync("the following meters are available at the PataPawa PrePay Host", ((string)(null)), table8, "Given "); #line hidden - global::Reqnroll.Table table81 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table9 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table81.AddRow(new string[] { + table9.AddRow(new string[] { "Test Estate 1"}); - table81.AddRow(new string[] { + table9.AddRow(new string[] { "Test Estate 2"}); -#line 31 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table81, "Given "); +#line 45 + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table9, "Given "); #line hidden - global::Reqnroll.Table table82 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table10 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table82.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); - table82.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 1", "Voucher", "True", "True"}); - table82.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 2", "Safaricom", "True", "True"}); - table82.AddRow(new string[] { + table10.AddRow(new string[] { "Test Estate 2", "Voucher", "True", "True"}); -#line 36 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table82, "Given "); +#line 50 + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table10, "Given "); #line hidden - global::Reqnroll.Table table83 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table11 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table83.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 1", "Safaricom"}); - table83.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 1", "Voucher"}); - table83.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 2", "Safaricom"}); - table83.AddRow(new string[] { + table11.AddRow(new string[] { "Test Estate 2", "Voucher"}); -#line 43 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table83, "And "); +#line 57 + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table11, "And "); #line hidden - global::Reqnroll.Table table84 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table12 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table84.AddRow(new string[] { + table12.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); - table84.AddRow(new string[] { + table12.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract"}); - table84.AddRow(new string[] { + table12.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract"}); - table84.AddRow(new string[] { + table12.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract"}); -#line 50 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table84, "Given "); +#line 64 + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table12, "Given "); #line hidden - global::Reqnroll.Table table85 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table13 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -281,7 +318,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -289,7 +326,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Test Estate 1", "Voucher", "Hospital 1 Contract", @@ -297,7 +334,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -305,7 +342,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Custom", "", "MobileTopup"}); - table85.AddRow(new string[] { + table13.AddRow(new string[] { "Test Estate 2", "Voucher", "Hospital 1 Contract", @@ -313,10 +350,10 @@ await testRunner.GivenAsync("I have a token to access the estate management and "10 KES", "", "Voucher"}); -#line 57 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table85, "When "); +#line 71 + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table13, "When "); #line hidden - global::Reqnroll.Table table86 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table14 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -324,7 +361,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table86.AddRow(new string[] { + table14.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -332,7 +369,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Fixed", "Merchant Commission", "2.50"}); - table86.AddRow(new string[] { + table14.AddRow(new string[] { "Test Estate 2", "Safaricom", "Safaricom Contract", @@ -340,10 +377,10 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Percentage", "Merchant Commission", "0.85"}); -#line 64 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table86, "When "); +#line 78 + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table14, "When "); #line hidden - global::Reqnroll.Table table87 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table15 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "Town", @@ -353,7 +390,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table87.AddRow(new string[] { + table15.AddRow(new string[] { "Test Merchant 1", "Address Line 1", "TestTown", @@ -363,7 +400,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 1", "testcontact1@merchant1.co.uk", "Test Estate 1"}); - table87.AddRow(new string[] { + table15.AddRow(new string[] { "Test Merchant 2", "Address Line 1", "TestTown", @@ -373,7 +410,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 2", "testcontact2@merchant2.co.uk", "Test Estate 1"}); - table87.AddRow(new string[] { + table15.AddRow(new string[] { "Test Merchant 3", "Address Line 1", "TestTown", @@ -383,161 +420,161 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Contact 3", "testcontact3@merchant2.co.uk", "Test Estate 2"}); -#line 69 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table87, "Given "); +#line 83 + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table15, "Given "); #line hidden - global::Reqnroll.Table table88 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table88.AddRow(new string[] { + table16.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table88.AddRow(new string[] { + table16.AddRow(new string[] { "Voucher", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); - table88.AddRow(new string[] { + table16.AddRow(new string[] { "Safaricom", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table88.AddRow(new string[] { + table16.AddRow(new string[] { "Voucher", "Test Merchant 2", "00000002", "10000002", "Test Estate 1"}); - table88.AddRow(new string[] { + table16.AddRow(new string[] { "Safaricom", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); - table88.AddRow(new string[] { + table16.AddRow(new string[] { "Voucher", "Test Merchant 3", "00000003", "10000003", "Test Estate 2"}); -#line 75 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table88, "Given "); +#line 89 + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table16, "Given "); #line hidden - global::Reqnroll.Table table89 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { "DeviceIdentifier", "MerchantName", "EstateName"}); - table89.AddRow(new string[] { + table17.AddRow(new string[] { "123456780", "Test Merchant 1", "Test Estate 1"}); - table89.AddRow(new string[] { + table17.AddRow(new string[] { "123456781", "Test Merchant 2", "Test Estate 1"}); - table89.AddRow(new string[] { + table17.AddRow(new string[] { "123456782", "Test Merchant 3", "Test Estate 2"}); -#line 84 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table89, "Given "); +#line 98 + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table17, "Given "); #line hidden - global::Reqnroll.Table table90 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table18 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table90.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); - table90.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Hospital 1 Contract"}); - table90.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Safaricom Contract"}); - table90.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 1", "Test Merchant 2", "Hospital 1 Contract"}); - table90.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Safaricom Contract"}); - table90.AddRow(new string[] { + table18.AddRow(new string[] { "Test Estate 2", "Test Merchant 3", "Hospital 1 Contract"}); -#line 90 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table90, "When "); +#line 104 + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table18, "When "); #line hidden - global::Reqnroll.Table table91 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table19 = new global::Reqnroll.Table(new string[] { "Reference", "Amount", "DateTime", "MerchantName", "EstateName"}); - table91.AddRow(new string[] { + table19.AddRow(new string[] { "Deposit1", "210.00", "Today", "Test Merchant 1", "Test Estate 1"}); - table91.AddRow(new string[] { + table19.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 2", "Test Estate 1"}); - table91.AddRow(new string[] { + table19.AddRow(new string[] { "Deposit1", "110.00", "Today", "Test Merchant 3", "Test Estate 2"}); -#line 99 - await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table91, "Given "); +#line 113 + await testRunner.GivenAsync("I make the following manual merchant deposits", ((string)(null)), table19, "Given "); #line hidden - global::Reqnroll.Table table92 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table20 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName", "MerchantName"}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "merchantuser@testmerchant1.co.uk", "123456", "TestMerchant", "User1", "Test Estate 1", "Test Merchant 1"}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "merchantuser@testmerchant2.co.uk", "123456", "TestMerchant", "User2", "Test Estate 1", "Test Merchant 2"}); - table92.AddRow(new string[] { + table20.AddRow(new string[] { "merchantuser@testmerchant3.co.uk", "123456", "TestMerchant", "User3", "Test Estate 2", "Test Merchant 3"}); -#line 105 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table92, "Given "); +#line 119 + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table20, "Given "); #line hidden } @@ -558,7 +595,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Merchant daily performance summary", null, tagsOfScenario, argumentsOfScenario, featureTags, pickleIndex); string[] tagsOfRule = ((string[])(null)); global::Reqnroll.RuleInfo ruleInfo = null; -#line 112 +#line 126 this.ScenarioInitialize(scenarioInfo, ruleInfo); #line hidden if ((global::Reqnroll.TagHelper.ContainsIgnoreTag(scenarioInfo.CombinedTags) || global::Reqnroll.TagHelper.ContainsIgnoreTag(featureTags))) @@ -571,12 +608,12 @@ await testRunner.GivenAsync("I have a token to access the estate management and #line 4 await this.FeatureBackgroundAsync(); #line hidden -#line 113 +#line 127 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant1.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table93 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table21 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -591,7 +628,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ProductName", "RecipientEmail", "RecipientMobile"}); - table93.AddRow(new string[] { + table21.AddRow(new string[] { "Today", "8", "Sale", @@ -606,14 +643,14 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Variable Topup", "", ""}); -#line 114 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table93, "When "); +#line 128 + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table21, "When "); #line hidden -#line 118 +#line 132 await testRunner.WhenAsync("I get the merchant daily performance summary for Merchant \"Test Merchant 1\" for E" + "state \"Test Estate 1\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 119 +#line 133 await testRunner.ThenAsync("the merchant daily performance summary response should contain at least one metri" + "c and the sale amount 50.00", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden @@ -633,7 +670,7 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Merchant transaction mix summary", null, tagsOfScenario, argumentsOfScenario, featureTags, pickleIndex); string[] tagsOfRule = ((string[])(null)); global::Reqnroll.RuleInfo ruleInfo = null; -#line 122 +#line 136 this.ScenarioInitialize(scenarioInfo, ruleInfo); #line hidden if ((global::Reqnroll.TagHelper.ContainsIgnoreTag(scenarioInfo.CombinedTags) || global::Reqnroll.TagHelper.ContainsIgnoreTag(featureTags))) @@ -646,12 +683,12 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou #line 4 await this.FeatureBackgroundAsync(); #line hidden -#line 123 +#line 137 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant1.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table94 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table22 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -666,7 +703,7 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou "ProductName", "RecipientEmail", "RecipientMobile"}); - table94.AddRow(new string[] { + table22.AddRow(new string[] { "Today", "9", "Sale", @@ -681,14 +718,14 @@ await testRunner.ThenAsync("the merchant daily performance summary response shou "Variable Topup", "", ""}); -#line 124 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table94, "When "); +#line 138 + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table22, "When "); #line hidden -#line 128 +#line 142 await testRunner.WhenAsync("I get the merchant transaction mix summary for Merchant \"Test Merchant 1\" for Est" + "ate \"Test Estate 1\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 129 +#line 143 await testRunner.ThenAsync("the merchant transaction mix summary response should contain at least one item an" + "d the sale amount 25.00", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden @@ -708,7 +745,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Recent activity receipt search supports paging", null, tagsOfScenario, argumentsOfScenario, featureTags, pickleIndex); string[] tagsOfRule = ((string[])(null)); global::Reqnroll.RuleInfo ruleInfo = null; -#line 132 +#line 146 this.ScenarioInitialize(scenarioInfo, ruleInfo); #line hidden if ((global::Reqnroll.TagHelper.ContainsIgnoreTag(scenarioInfo.CombinedTags) || global::Reqnroll.TagHelper.ContainsIgnoreTag(featureTags))) @@ -721,12 +758,12 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should #line 4 await this.FeatureBackgroundAsync(); #line hidden -#line 133 +#line 147 await testRunner.GivenAsync("I am logged in as \"merchantuser@testmerchant1.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 1\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table95 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table23 = new global::Reqnroll.Table(new string[] { "DateTime", "TransactionNumber", "TransactionType", @@ -741,7 +778,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "ProductName", "RecipientEmail", "RecipientMobile"}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1001", "Sale", @@ -756,7 +793,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1002", "Sale", @@ -771,7 +808,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1003", "Sale", @@ -786,7 +823,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1004", "Sale", @@ -801,7 +838,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1005", "Sale", @@ -816,7 +853,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1006", "Sale", @@ -831,7 +868,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1007", "Sale", @@ -846,7 +883,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1008", "Sale", @@ -861,7 +898,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1009", "Sale", @@ -876,7 +913,7 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); - table95.AddRow(new string[] { + table23.AddRow(new string[] { "Today", "1010", "Sale", @@ -891,22 +928,22 @@ await testRunner.ThenAsync("the merchant transaction mix summary response should "Variable Topup", "", ""}); -#line 134 - await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table95, "When "); +#line 148 + await testRunner.WhenAsync("I perform the following transactions", ((string)(null)), table23, "When "); #line hidden -#line 147 +#line 161 await testRunner.WhenAsync("I get the recent activity receipt search for Merchant \"Test Merchant 1\" for Estat" + - "e \"Test Estate 1\" page 1 size 5", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + "e \"Test Estate 1\" page 1 size 5 expecting total count 10", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 148 +#line 162 await testRunner.ThenAsync("the recent activity receipt search response for page 1 should contain 5 items and" + " total count 10", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 150 +#line 164 await testRunner.WhenAsync("I get the recent activity receipt search for Merchant \"Test Merchant 1\" for Estat" + - "e \"Test Estate 1\" page 2 size 5", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + "e \"Test Estate 1\" page 2 size 5 expecting total count 10", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 151 +#line 165 await testRunner.ThenAsync("the recent activity receipt search response for page 2 should contain 5 items and" + " total count 10", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden diff --git a/TransactionProcessorACL.IntegrationTests/Shared/ACLSteps.cs b/TransactionProcessorACL.IntegrationTests/Shared/ACLSteps.cs index 7eb5370..fe5a519 100644 --- a/TransactionProcessorACL.IntegrationTests/Shared/ACLSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Shared/ACLSteps.cs @@ -52,7 +52,7 @@ public async Task SendAclSaleRequestMessage((EstateDetails, String, Guid, String CancellationToken cancellationToken) { String uri = "api/saletransactions"; - await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, "Sale", cancellationToken); + await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, cancellationToken); } public async Task SendAclLogonRequestMessage((EstateDetails, String, Guid, String, LogonTransactionRequestMessage) requestMessage, @@ -60,7 +60,7 @@ public async Task SendAclLogonRequestMessage((EstateDetails, String, Guid, Strin { String uri = "api/logontransactions"; - await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, "Logon", cancellationToken); + await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, cancellationToken); } public async Task SendAclReconciliationRequestMessage((EstateDetails, String, Guid, String, ReconciliationRequestMessage) requestMessage, @@ -68,7 +68,7 @@ public async Task SendAclReconciliationRequestMessage((EstateDetails, String, Gu { String uri = "api/reconciliationtransactions"; - await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, "Reconciliation", cancellationToken); + await this.SendAclRequestMessage(uri, requestMessage.Item5, requestMessage.Item2, requestMessage.Item3, requestMessage.Item1, requestMessage.Item4, cancellationToken); } private async Task SendAclRequestMessage(String uri, @@ -77,7 +77,6 @@ private async Task SendAclRequestMessage(String uri, Guid merchantId, EstateDetails estateDetails, String transactionNumber, - String expectedTransactionType, CancellationToken cancellationToken) { StringContent content = new StringContent(StringSerialiser.Serialise(request), Encoding.UTF8, @@ -91,12 +90,11 @@ private async Task SendAclRequestMessage(String uri, responseContent.ShouldNotBeNullOrEmpty("No response message received"); - TransactionResponse transactionResponse = StringSerialiser.Deserialise(responseContent); - + TransactionResponse transactionResponse = StringSerialiser.Deserialise(responseContent, new SerialiserOptions(SerialiserPropertyFormat.SnakeCase)); + TransactionResponseAssertions.Verify(transactionResponse, estateDetails.EstateId, - merchantId, - expectedTransactionType); + merchantId); estateDetails.AddTransactionResponse(merchantId, transactionNumber, transactionResponse); } @@ -351,6 +349,7 @@ public async Task WhenIGetTheRecentActivityReceiptSearchForMerchantForEstate(Str String merchantName, Int32 pageNumber, Int32 pageSize, + Int32 expectedTotalCount, List estateDetailsList, CancellationToken cancellationToken) { @@ -387,6 +386,10 @@ await Retry.ForEventually(async () => { StringSerialiser.Deserialise(responseContent, new SerialiserOptions(SerialiserPropertyFormat.SnakeCase)); + // The reporting read model is eventually consistent with transaction writes. + // Do not complete the retry until this page can be expected to be complete. + searchResponse.TotalCount.ShouldBe(expectedTotalCount); + this.RecentActivityReceiptSearchResponses[pageNumber] = searchResponse; this.LastRecentActivityReceiptSearchEstateDetails = es1; this.LastRecentActivityReceiptSearchMerchantId = merchantId; diff --git a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs index 367d9e2..a3b29d0 100644 --- a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs @@ -528,16 +528,18 @@ public void ThenTheMerchantTransactionMixSummaryResponseShouldContainAtLeastOneI this.AclSteps.ThenTheMerchantTransactionMixSummaryResponseShouldContainAtLeastOneItemAndTheSaleAmount(saleAmount); } - [When("I get the recent activity receipt search for Merchant {string} for Estate {string} page {int} size {int}")] + [When("I get the recent activity receipt search for Merchant {string} for Estate {string} page {int} size {int} expecting total count {int}")] public async Task WhenIGetTheRecentActivityReceiptSearchForMerchantForEstatePageSize(string merchantName, string estateName, int pageNumber, - int pageSize) + int pageSize, + int expectedTotalCount) { await this.AclSteps.WhenIGetTheRecentActivityReceiptSearchForMerchantForEstate(estateName, merchantName, pageNumber, pageSize, + expectedTotalCount, this.TestingContext.Estates, CancellationToken.None); } diff --git a/TransactionProcessorACL/Bootstrapper/MediatorRegistry.cs b/TransactionProcessorACL/Bootstrapper/MediatorRegistry.cs index 943cb59..b9d6fdc 100644 --- a/TransactionProcessorACL/Bootstrapper/MediatorRegistry.cs +++ b/TransactionProcessorACL/Bootstrapper/MediatorRegistry.cs @@ -35,8 +35,8 @@ public MediatorRegistry() { RequestAuditStreamLifetimeDays = requestAuditStreamLifetimeDays }); - this.AddSingleton(); - this.AddTransient(typeof(IPipelineBehavior<,>), typeof(AuditPipelineBehavior<,>)); + //this.AddSingleton(); + //this.AddTransient(typeof(IPipelineBehavior<,>), typeof(AuditPipelineBehavior<,>)); this.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(VersionCheckRequestHandler).Assembly)); } diff --git a/TransactionProcessorACL/Bootstrapper/MiddlewareRegistry.cs b/TransactionProcessorACL/Bootstrapper/MiddlewareRegistry.cs index e67550b..a3fcd08 100644 --- a/TransactionProcessorACL/Bootstrapper/MiddlewareRegistry.cs +++ b/TransactionProcessorACL/Bootstrapper/MiddlewareRegistry.cs @@ -30,7 +30,6 @@ public MiddlewareRegistry() this.ConfigureHealthChecks(); this.ConfigureAuthentication(); this.ConfigurePasswordTokenHandling(); - this.AddSingleton(); this.ConfigureJsonOptions(); this.ConfigureControllers(); this.AddHealthMonitoringRegistration(Startup.Configuration); @@ -112,7 +111,7 @@ private void ConfigureJsonOptions() private void ConfigurePasswordTokenHandling() { this.AddPasswordTokenPolicy(); - this.AddPasswordTokenHandler(); + this.AddPasswordTokenHandler(); } } diff --git a/TransactionProcessorACL/Middleware/AuthorizationFailureDiagnosticsHandler.cs b/TransactionProcessorACL/Middleware/AuthorizationFailureDiagnosticsHandler.cs deleted file mode 100644 index 7b88649..0000000 --- a/TransactionProcessorACL/Middleware/AuthorizationFailureDiagnosticsHandler.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Authorization.Policy; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Logging; - -namespace TransactionProcessorACL.Middleware; - -/// -/// Temporary diagnostics for authorization failures. This logs policy metadata only. -/// -public sealed class AuthorizationFailureDiagnosticsHandler : IAuthorizationMiddlewareResultHandler -{ - private readonly AuthorizationMiddlewareResultHandler InnerHandler = new(); - private readonly ILogger Logger; - - public AuthorizationFailureDiagnosticsHandler(ILogger logger) - { - this.Logger = logger; - } - - public async Task HandleAsync(RequestDelegate next, - HttpContext context, - AuthorizationPolicy policy, - PolicyAuthorizationResult authorizeResult) - { - if (authorizeResult.Succeeded == false) - { - string policyRequirements = String.Join(", ", policy.Requirements.Select(requirement => requirement.GetType().FullName)); - string failedRequirements = authorizeResult.AuthorizationFailure == null - ? String.Empty - : String.Join(", ", authorizeResult.AuthorizationFailure.FailedRequirements.Select(requirement => requirement.GetType().FullName)); - string failureReasons = authorizeResult.AuthorizationFailure == null - ? String.Empty - : String.Join("; ", authorizeResult.AuthorizationFailure.FailureReasons.Select(reason => reason.Message)); - - this.Logger.LogWarning("Authorization failure diagnostics: Method={Method}; Path={Path}; Requirements={Requirements}; FailedRequirements={FailedRequirements}; FailureReasons={FailureReasons}", - context.Request.Method, - context.Request.Path, - policyRequirements, - failedRequirements, - failureReasons); - } - - await this.InnerHandler.HandleAsync(next, context, policy, authorizeResult).ConfigureAwait(false); - } -} diff --git a/TransactionProcessorACL/Startup.cs b/TransactionProcessorACL/Startup.cs index 695393d..5809d54 100644 --- a/TransactionProcessorACL/Startup.cs +++ b/TransactionProcessorACL/Startup.cs @@ -5,8 +5,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using TransactionProcessorACL.Endpoints; -using System.Linq; -using Microsoft.AspNetCore.Authorization; namespace TransactionProcessorACL { @@ -95,29 +93,6 @@ private static void ConfigureMiddleware(IApplicationBuilder app) app.AddExceptionHandler(); app.UseRouting(); app.UseAuthentication(); - app.Use(async (context, next) => - { - if (context.Request.Path.StartsWithSegments("/api/reporting") && - context.User.Identity?.IsAuthenticated == true) - { - ILogger logger = context.RequestServices.GetRequiredService() - .CreateLogger("TransactionProcessorACL.AuthenticationDiagnostics"); - - String claims = String.Join("; ", context.User.Claims.Select(claim => $"{claim.Type}={claim.Value}")); - String authorizationMetadata = String.Join(", ", context.GetEndpoint()?.Metadata - .GetOrderedMetadata() - .Select(metadata => $"Policy={metadata.Policy ?? ""}; Roles={metadata.Roles ?? ""}") - ?? Enumerable.Empty()); - logger.LogWarning("Temporary authentication diagnostics: AuthenticationType={AuthenticationType}; Claims={Claims}", - context.User.Identity.AuthenticationType, - claims); - logger.LogWarning("Temporary endpoint authorization diagnostics: Endpoint={Endpoint}; Metadata={Metadata}", - context.GetEndpoint()?.DisplayName, - authorizationMetadata); - } - - await next(); - }); app.UseAuthorization(); app.UseMiddleware(); app.UseMiddleware(); From 7ade5f25bb0865a86912c64c430e3867da5c5640 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Wed, 14 Oct 2026 13:54:32 +0100 Subject: [PATCH 6/6] fix failing recon test --- .../Services/TransactionProcessorACLApplicationService.cs | 2 ++ TransactionProcessorACL.IntegrationTests/AssemblyInfo.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs b/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs index 2aae528..b92449d 100644 --- a/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs +++ b/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs @@ -807,6 +807,8 @@ private static ProcessReconciliationResponse CreateProcessReconciliationResponse ResponseCode = reconciliationResponse.ResponseCode, ResponseMessage = reconciliationResponse.ResponseMessage, TransactionId = reconciliationResponse.TransactionId, + EstateId = reconciliationResponse.EstateId, + MerchantId = reconciliationResponse.MerchantId, }; } diff --git a/TransactionProcessorACL.IntegrationTests/AssemblyInfo.cs b/TransactionProcessorACL.IntegrationTests/AssemblyInfo.cs index 24d036a..2bf6799 100644 --- a/TransactionProcessorACL.IntegrationTests/AssemblyInfo.cs +++ b/TransactionProcessorACL.IntegrationTests/AssemblyInfo.cs @@ -16,5 +16,5 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM. [assembly: Guid("25d4d6fc-b809-4acc-a910-249a03e5f07a")] -[assembly: LevelOfParallelism(1)] +[assembly: LevelOfParallelism(3)] [assembly: Parallelizable(ParallelScope.Fixtures)]