aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
index 5ddbd30d1..4e8aec9f1 100644
--- a/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
+++ b/tests/Jellyfin.Server.Integration.Tests/AuthHelper.cs
@@ -40,9 +40,7 @@ namespace Jellyfin.Server.Integration.Tests
using var authResponse = await client.SendAsync(httpRequest);
authResponse.EnsureSuccessStatusCode();
- var auth = await JsonSerializer.DeserializeAsync<AuthenticationResultDto>(
- await authResponse.Content.ReadAsStreamAsync(),
- jsonOptions);
+ var auth = await authResponse.Content.ReadFromJsonAsync<AuthenticationResultDto>(jsonOptions);
return auth!.AccessToken;
}
@@ -51,8 +49,7 @@ namespace Jellyfin.Server.Integration.Tests
{
using var response = await client.GetAsync("Users/Me");
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var userDto = await JsonSerializer.DeserializeAsync<UserDto>(
- await response.Content.ReadAsStreamAsync(), JsonDefaults.Options);
+ var userDto = await response.Content.ReadFromJsonAsync<UserDto>(JsonDefaults.Options);
Assert.NotNull(userDto);
return userDto;
}
@@ -67,9 +64,7 @@ namespace Jellyfin.Server.Integration.Tests
var response = await client.GetAsync($"Users/{userId}/Items/Root");
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- var rootDto = await JsonSerializer.DeserializeAsync<BaseItemDto>(
- await response.Content.ReadAsStreamAsync(),
- JsonDefaults.Options);
+ var rootDto = await response.Content.ReadFromJsonAsync<BaseItemDto>(JsonDefaults.Options);
Assert.NotNull(rootDto);
return rootDto;
}