diff --git a/application/account-management/Tests/Api/ApiCore/CustomExceptionHandlingTests.cs b/application/account-management/Tests/Api/ApiCore/CustomExceptionHandlingTests.cs index 460d1d597..d0df5d139 100644 --- a/application/account-management/Tests/Api/ApiCore/CustomExceptionHandlingTests.cs +++ b/application/account-management/Tests/Api/ApiCore/CustomExceptionHandlingTests.cs @@ -22,13 +22,13 @@ public async Task CustomExceptionHandling_WhenThrowingException_ShouldHandleExce builder.UseSetting(WebHostDefaults.EnvironmentKey, environment); builder.ConfigureAppConfiguration((_, _) => { - // Set the environment variable to enable the test-specific /throwException endpoint. + // Set the environment variable to enable the test-specific /api/throwException endpoint. Environment.SetEnvironmentVariable("TestEndpointsEnabled", "true"); }); }).CreateClient(); // Act - var response = await client.GetAsync("/throwException"); + var response = await client.GetAsync("/api/throwException"); // Assert if (environment == "Development") diff --git a/application/shared-kernel/ApiCore/ApiCoreConfiguration.cs b/application/shared-kernel/ApiCore/ApiCoreConfiguration.cs index 8d07b7ec7..df59479f0 100644 --- a/application/shared-kernel/ApiCore/ApiCoreConfiguration.cs +++ b/application/shared-kernel/ApiCore/ApiCoreConfiguration.cs @@ -101,7 +101,7 @@ public static WebApplication AddApiCoreConfiguration(this WebApplica app.UseMiddleware(); - // Add test-specific endpoints when running tests, such as /throwException. + // Add test-specific endpoints when running tests, such as /api/throwException. app.MapTestEndpoints(); app.Services.ApplyMigrations(); diff --git a/application/shared-kernel/ApiCore/Endpoints/TestEndpoints.cs b/application/shared-kernel/ApiCore/Endpoints/TestEndpoints.cs index b1cbb68ec..fdcbbda42 100644 --- a/application/shared-kernel/ApiCore/Endpoints/TestEndpoints.cs +++ b/application/shared-kernel/ApiCore/Endpoints/TestEndpoints.cs @@ -10,6 +10,6 @@ public static void MapTestEndpoints(this IEndpointRouteBuilder routes) if (!bool.TryParse(Environment.GetEnvironmentVariable("TestEndpointsEnabled"), out _)) return; // Add a dummy endpoint that throws an InvalidOperationException for testing purposes. - routes.MapGet("/throwException", _ => throw new InvalidOperationException("Dummy endpoint for testing.")); + routes.MapGet("/api/throwException", _ => throw new InvalidOperationException("Dummy endpoint for testing.")); } } \ No newline at end of file