Skip to content

Commit

Permalink
Align controller loading for ATTs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmarbach committed Mar 12, 2024
1 parent ab09a43 commit 68f81db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
@@ -1,7 +1,6 @@
namespace ServiceControl.AcceptanceTests.RavenDB.Shared;

using System;
using Infrastructure.WebApi;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.TestHost;
Expand All @@ -28,7 +27,7 @@ public static void AddServiceControlTesting(this WebApplicationBuilder hostBuild
// inside a test runner the runner exe becomes the entry point which obviously has no controllers in it ;)
// so we are explicitly registering all necessary application parts.
var addControllers = hostBuilder.Services.AddControllers();
addControllers.AddApplicationPart(typeof(WebApiHostBuilderExtensions).Assembly);
addControllers.AddApplicationPart(typeof(Settings).Assembly);
addControllers.AddApplicationPart(typeof(AcceptanceTest).Assembly);

hostBuilder.Services.AddHttpClientDefaultsOverrides(settings);
Expand Down
Expand Up @@ -25,7 +25,7 @@ public static void AddServiceControlAuditTesting(this WebApplicationBuilder host
// inside a test runner the runner exe becomes the entry point which obviously has no controllers in it ;)
// so we are explicitly registering all necessary application parts.
var addControllers = hostBuilder.Services.AddControllers();
addControllers.AddApplicationPart(typeof(WebApiHostBuilderExtensions).Assembly);
addControllers.AddApplicationPart(typeof(FailedAuditsController).Assembly);
addControllers.AddApplicationPart(typeof(Settings).Assembly);
addControllers.AddApplicationPart(typeof(AcceptanceTest).Assembly);
}
}
Expand Up @@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;

static class WebApiHostBuilderExtensions
static class WebApplicationBuilderExtensions
{
public static void AddWebApi(this WebApplicationBuilder builder, string rootUrl)
{
Expand Down
@@ -1,6 +1,7 @@
namespace ServiceControl.Monitoring.AcceptanceTests.TestSupport;

using System;
using Infrastructure;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.TestHost;
Expand All @@ -21,6 +22,7 @@ public static void AddServiceControlMonitoringTesting(this WebApplicationBuilder
// inside a test runner the runner exe becomes the entry point which obviously has no controllers in it ;)
// so we are explicitly registering all necessary application parts.
var addControllers = hostBuilder.Services.AddControllers();
addControllers.AddApplicationPart(typeof(WebApplicationBuilderExtensions).Assembly);
addControllers.AddApplicationPart(typeof(Settings).Assembly);
addControllers.AddApplicationPart(typeof(AcceptanceTest).Assembly);
}
}

0 comments on commit 68f81db

Please sign in to comment.