From 70077758f1bf55ea04cddc0d23364ca772a1218b Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Wed, 30 Oct 2024 13:54:30 +0300 Subject: [PATCH] fix ci failure.... --- src/generated/KiotaVersionGenerator.cs | 2 +- tests/http/httpClient/Middleware/AuthorizationHandlerTests.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generated/KiotaVersionGenerator.cs b/src/generated/KiotaVersionGenerator.cs index 3bf9f92..04f2580 100644 --- a/src/generated/KiotaVersionGenerator.cs +++ b/src/generated/KiotaVersionGenerator.cs @@ -20,7 +20,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) try { XmlDocument csproj = new XmlDocument(); - projectDirectory = Path.Combine(projectDirectory, "..", "..", "..", "..", "Directory.Build.props"); + projectDirectory = Path.Combine(projectDirectory, "..", "..", "..", "Directory.Build.props"); csproj.Load(projectDirectory); var version = csproj.GetElementsByTagName("VersionPrefix")[0].InnerText; string source = $@"// diff --git a/tests/http/httpClient/Middleware/AuthorizationHandlerTests.cs b/tests/http/httpClient/Middleware/AuthorizationHandlerTests.cs index aae728b..a1ae87b 100644 --- a/tests/http/httpClient/Middleware/AuthorizationHandlerTests.cs +++ b/tests/http/httpClient/Middleware/AuthorizationHandlerTests.cs @@ -67,6 +67,7 @@ public async Task AuthorizationHandlerShouldAddAuthHeaderIfNotPresent() // Act HttpResponseMessage response = await this._invoker.SendAsync(httpRequestMessage, new CancellationToken()); // Assert + Assert.NotNull(response.RequestMessage); Assert.True(response.RequestMessage.Headers.Contains("Authorization")); Assert.True(response.RequestMessage.Headers.GetValues("Authorization").Count() == 1); Assert.Equal($"Bearer {_expectedAccessToken}", response.RequestMessage.Headers.GetValues("Authorization").First()); @@ -86,6 +87,7 @@ public async Task AuthorizationHandlerShouldNotAddAuthHeaderIfPresent() HttpResponseMessage response = await this._invoker.SendAsync(httpRequestMessage, new CancellationToken()); // Assert + Assert.NotNull(response.RequestMessage); Assert.True(response.RequestMessage.Headers.Contains("Authorization")); Assert.True(response.RequestMessage.Headers.GetValues("Authorization").Count() == 1); Assert.Equal($"Bearer existing", response.RequestMessage.Headers.GetValues("Authorization").First()); @@ -106,6 +108,7 @@ public async Task AuthorizationHandlerShouldAttemptCAEClaimsChallenge() HttpResponseMessage response = await this._invoker.SendAsync(httpRequestMessage, new CancellationToken()); // Assert + Assert.NotNull(response.RequestMessage); Assert.True(response.RequestMessage.Headers.Contains("Authorization")); Assert.True(response.RequestMessage.Headers.GetValues("Authorization").Count() == 1); Assert.Equal($"Bearer {_expectedAccessTokenAfterCAE}", response.RequestMessage.Headers.GetValues("Authorization").First());