diff --git a/CallbackHandler.IntegrationTests/Common/DockerHelper.cs b/CallbackHandler.IntegrationTests/Common/DockerHelper.cs index d25c904..39dfd8c 100644 --- a/CallbackHandler.IntegrationTests/Common/DockerHelper.cs +++ b/CallbackHandler.IntegrationTests/Common/DockerHelper.cs @@ -17,6 +17,8 @@ public DockerHelper() { public ITransactionProcessorClient TransactionProcessorClient; public EventStoreProjectionManagementClient ProjectionManagementClient; + public String AccessToken; + public IAgencyBankingClient AgencyBankingClient; public HttpClient TestHostHttpClient; @@ -75,6 +77,14 @@ public override async Task StartContainersForScenarioRun(String scenarioName, this.TestHostHttpClient = new HttpClient(clientHandler); this.TestHostHttpClient.BaseAddress = new Uri($"http://127.0.0.1:{this.TestHostServicePort}"); this.AgencyBankingClient = new AgencyBankingClient(TestHostServiceBaseAddressResolver, httpClient, Serialise_CamelCase, this.Deserialise_CamelCase); + + + 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; } String Serialise(Object arg) diff --git a/CallbackHandler.IntegrationTests/Shared/SharedSteps.cs b/CallbackHandler.IntegrationTests/Shared/SharedSteps.cs index e78c7c0..0835a07 100644 --- a/CallbackHandler.IntegrationTests/Shared/SharedSteps.cs +++ b/CallbackHandler.IntegrationTests/Shared/SharedSteps.cs @@ -35,7 +35,8 @@ public SharedSteps(ScenarioContext scenarioContext, { 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); diff --git a/Directory.Packages.props b/Directory.Packages.props index fd726ba..7e3746f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,7 +3,7 @@ true - + @@ -20,20 +20,20 @@ - - - - - - + + + + + + - - + + - +