|
2 | 2 | // The .NET Foundation licenses this file to you under the Apache 2.0 License. |
3 | 3 | // See the LICENSE file in the project root for more information. |
4 | 4 |
|
5 | | -using Microsoft.AspNetCore.Builder; |
6 | 5 | using Microsoft.AspNetCore.Cors.Infrastructure; |
7 | 6 | using Microsoft.AspNetCore.Hosting; |
8 | 7 | using Microsoft.Extensions.Configuration; |
9 | 8 | using Microsoft.Extensions.DependencyInjection; |
10 | | -using Microsoft.Extensions.Logging; |
11 | 9 | using Microsoft.Extensions.Options; |
12 | 10 | using Steeltoe.Common.TestResources; |
13 | 11 | using Steeltoe.Management.Endpoint.Actuators.All; |
@@ -134,24 +132,4 @@ public async Task Does_not_register_duplicate_services(HostBuilderType hostBuild |
134 | 132 | host.Services.GetServices<InfoEndpointMiddleware>().Should().ContainSingle(); |
135 | 133 | host.Services.GetServices<IEndpointMiddleware>().OfType<InfoEndpointMiddleware>().Should().ContainSingle(); |
136 | 134 | } |
137 | | - |
138 | | - [Fact] |
139 | | - public async Task Logs_warning_when_custom_middleware_is_registered_without_configureMiddleware_false() |
140 | | - { |
141 | | - using var capturingLoggerProvider = new CapturingLoggerProvider((_, logLevel) => logLevel >= LogLevel.Warning); |
142 | | - |
143 | | - WebApplicationBuilder builder = TestWebApplicationBuilderFactory.Create(); |
144 | | - builder.Logging.AddProvider(capturingLoggerProvider); |
145 | | - builder.Services.AddAllActuators(); |
146 | | - await using WebApplication host = builder.Build(); |
147 | | - |
148 | | - host.UseRouting(); |
149 | | - host.UseActuatorEndpoints(); |
150 | | - |
151 | | - await host.StartAsync(TestContext.Current.CancellationToken); |
152 | | - |
153 | | - capturingLoggerProvider.GetAll().Should().Contain($"WARN {typeof(ConfigureActuatorsMiddlewareStartupFilter)}: " + |
154 | | - "Actuators were registered with automatic middleware setup, and at least one additional middleware was registered afterward. This combination is usually undesired. " + |
155 | | - "To remove this warning, either remove the additional middleware registration or set configureMiddleware to false when registering actuators."); |
156 | | - } |
157 | 135 | } |
0 commit comments