mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Fix integration tests
This commit is contained in:
parent
1e1e1560a4
commit
b0120d5d4c
@ -8,9 +8,9 @@ using Jellyfin.Server.Helpers;
|
|||||||
using MediaBrowser.Common;
|
using MediaBrowser.Common;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Mvc.Testing;
|
using Microsoft.AspNetCore.Mvc.Testing;
|
||||||
using Microsoft.AspNetCore.TestHost;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Logging.Abstractions;
|
using Microsoft.Extensions.Logging.Abstractions;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
@ -39,9 +39,9 @@ namespace Jellyfin.Server.Integration.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
protected override IWebHostBuilder CreateWebHostBuilder()
|
protected override IHostBuilder CreateHostBuilder()
|
||||||
{
|
{
|
||||||
return new WebHostBuilder();
|
return new HostBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
@ -95,18 +95,17 @@ namespace Jellyfin.Server.Integration.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
protected override TestServer CreateServer(IWebHostBuilder builder)
|
protected override IHost CreateHost(IHostBuilder builder)
|
||||||
{
|
{
|
||||||
// Create the test server using the base implementation
|
var host = builder.Build();
|
||||||
var testServer = base.CreateServer(builder);
|
var appHost = (TestAppHost)host.Services.GetRequiredService<IApplicationHost>();
|
||||||
|
appHost.ServiceProvider = host.Services;
|
||||||
// Finish initializing the app host
|
|
||||||
var appHost = (TestAppHost)testServer.Services.GetRequiredService<IApplicationHost>();
|
|
||||||
appHost.ServiceProvider = testServer.Services;
|
|
||||||
appHost.InitializeServices().GetAwaiter().GetResult();
|
appHost.InitializeServices().GetAwaiter().GetResult();
|
||||||
|
host.Start();
|
||||||
|
|
||||||
appHost.RunStartupTasksAsync().GetAwaiter().GetResult();
|
appHost.RunStartupTasksAsync().GetAwaiter().GetResult();
|
||||||
|
|
||||||
return testServer;
|
return host;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user