1
0
mirror of https://github.com/bitwarden/server.git synced 2025-03-11 13:19:40 +01:00

Fix Api Integration Tests

This commit is contained in:
Justin Baur 2025-02-27 05:22:48 -05:00
parent 5dff881ef4
commit 6a8aec1e44
No known key found for this signature in database

View File

@ -1,4 +1,5 @@
using Bit.Identity.Models.Request.Accounts;
using Bit.Core.Platform.Infrastructure;
using Bit.Identity.Models.Request.Accounts;
using Bit.IntegrationTestCommon.Factories;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.TestHost;
@ -32,6 +33,16 @@ public class ApiApplicationFactory : WebApplicationFactoryBase<Startup>
var jobService = services.First(sd => sd.ServiceType == typeof(IHostedService) && sd.ImplementationType == typeof(Jobs.JobsHostedService));
services.Remove(jobService);
// Integration tests are not configured to use Azurite yet
var azureScaffolder = services.FirstOrDefault(
sd => sd.ServiceType == typeof(IHostedService) && sd.ImplementationType == typeof(AzureScaffolder)
);
if (azureScaffolder != null)
{
services.Remove(azureScaffolder);
}
services.Configure<JwtBearerOptions>(JwtBearerDefaults.AuthenticationScheme, options =>
{
options.BackchannelHttpHandler = _identityApplicationFactory.Server.CreateHandler();