From 576a9fe44e16bac77b750270c71f01faf6983df4 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Thu, 8 Oct 2026 16:37:58 +0100 Subject: [PATCH] fix failing nightly build --- Directory.Packages.props | 22 +++++++++---------- .../Common/DockerHelper.cs | 14 ++++++++---- .../Shared/SharedSteps.cs | 2 +- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 72bc80d..a68c04e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,9 +3,9 @@ true - - - + + + @@ -15,16 +15,16 @@ - + - - - - - + + + + + @@ -56,8 +56,8 @@ - - + + \ No newline at end of file diff --git a/MessagingService.IntegrationTests/Common/DockerHelper.cs b/MessagingService.IntegrationTests/Common/DockerHelper.cs index fdb46e9..8502fea 100644 --- a/MessagingService.IntegrationTests/Common/DockerHelper.cs +++ b/MessagingService.IntegrationTests/Common/DockerHelper.cs @@ -18,6 +18,7 @@ namespace MessagingService.IntegrationTests.Common using System.Collections.Generic; using System.Linq; using System.Net.Http; + using System.Threading; using System.Threading.Tasks; /// @@ -70,10 +71,8 @@ public override async Task CreateSubscriptions(){ } } - /// - /// Starts the containers for scenario run. - /// - /// Name of the scenario. + public String AccessToken; + public override async Task StartContainersForScenarioRun(String scenarioName, DockerServices dockerServices){ await base.StartContainersForScenarioRun(scenarioName, dockerServices); @@ -85,6 +84,13 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do this.SecurityServiceClient = new SecurityServiceClient(SecurityServiceBaseAddressResolver, httpClient, Serialise, Deserialise); this.MessagingServiceClient = new MessagingServiceClient(MessagingServiceBaseAddressResolver, httpClient, Serialise, Deserialise); + + 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; } #endregion diff --git a/MessagingService.IntegrationTests/Shared/SharedSteps.cs b/MessagingService.IntegrationTests/Shared/SharedSteps.cs index 8f86975..04e80bc 100644 --- a/MessagingService.IntegrationTests/Shared/SharedSteps.cs +++ b/MessagingService.IntegrationTests/Shared/SharedSteps.cs @@ -28,7 +28,7 @@ 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); } [Given(@"I create the following api scopes")]