From 6eb9c20fa8570264dcbac4f585a81b8d8f641b3c Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Tue, 31 Dec 2024 15:29:52 +0800 Subject: [PATCH] update --- MyApp.Tests/ImportTests.cs | 2 +- MyApp.Tests/TestUtils.cs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/MyApp.Tests/ImportTests.cs b/MyApp.Tests/ImportTests.cs index 200df94..22278db 100644 --- a/MyApp.Tests/ImportTests.cs +++ b/MyApp.Tests/ImportTests.cs @@ -259,7 +259,7 @@ public async Task Can_call_curl_to_get_url() [Test] public async Task Can_create_new_users() { - var client = TestUtils.CreateAdminProdClient(); + var client = await TestUtils.CreateAdminProdClientAsync(); var api = await client.ApiAsync(new EnsureApplicationUser { diff --git a/MyApp.Tests/TestUtils.cs b/MyApp.Tests/TestUtils.cs index 6a7ce10..410fe70 100644 --- a/MyApp.Tests/TestUtils.cs +++ b/MyApp.Tests/TestUtils.cs @@ -49,10 +49,8 @@ await client.ApiAsync(new Authenticate }); return client; } - public static JsonApiClient CreateAdminProdClient() => new("https://pvq.app") - { - BearerToken = Environment.GetEnvironmentVariable("AUTH_SECRET") - }; + public static JsonApiClient CreateAdminProdClient() => new JsonApiClient("https://pvq.app") + .Apply(c => c.AddHeader(Keywords.AuthSecret, Environment.GetEnvironmentVariable("AUTH_SECRET")!)); public static async Task CreateAdminProdClientAsync() {