diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f467b087ddf2..3c737fc32b41 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,181 +9,181 @@ --> - + https://github.com/dotnet/efcore - c50e2f6f1ab8681c9912cdd3443769988160aa31 + 926b37073d9a721432513ba7fdaee03543cc2d91 - + https://github.com/dotnet/efcore - c50e2f6f1ab8681c9912cdd3443769988160aa31 + 926b37073d9a721432513ba7fdaee03543cc2d91 - + https://github.com/dotnet/efcore - c50e2f6f1ab8681c9912cdd3443769988160aa31 + 926b37073d9a721432513ba7fdaee03543cc2d91 - + https://github.com/dotnet/efcore - c50e2f6f1ab8681c9912cdd3443769988160aa31 + 926b37073d9a721432513ba7fdaee03543cc2d91 - + https://github.com/dotnet/efcore - c50e2f6f1ab8681c9912cdd3443769988160aa31 + 926b37073d9a721432513ba7fdaee03543cc2d91 - + https://github.com/dotnet/efcore - c50e2f6f1ab8681c9912cdd3443769988160aa31 + 926b37073d9a721432513ba7fdaee03543cc2d91 - + https://github.com/dotnet/efcore - c50e2f6f1ab8681c9912cdd3443769988160aa31 + 926b37073d9a721432513ba7fdaee03543cc2d91 - + https://github.com/dotnet/efcore - c50e2f6f1ab8681c9912cdd3443769988160aa31 + 926b37073d9a721432513ba7fdaee03543cc2d91 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 https://github.com/dotnet/source-build-externals @@ -195,139 +195,139 @@ 27e584661980ee6d82c419a2a471ae505b7d122e - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 https://github.com/dotnet/runtime 5d54b08d5fc40d0b1c156f430a487a94c1e34f79 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 https://github.com/dotnet/xdt @@ -357,16 +357,16 @@ https://github.com/dotnet/roslyn 1aa759af23d2a29043ea44fcef5bd6823dafa5d0 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 - + https://github.com/dotnet/runtime - 40480e8e82b734a54c210f656361ff073353ffbe + 58bca2c54dcd1cc3b76989657bf218621668d836 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 86a6894873a3..a52adc100e2a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -63,88 +63,88 @@ --> - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 8.0.0-preview.7.23356.8 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 - 8.0.0-preview.7.23363.19 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 + 8.0.0-preview.7.23367.14 8.0.0-preview.7.23359.3 - 8.0.0-preview.7.23363.2 - 8.0.0-preview.7.23363.2 - 8.0.0-preview.7.23363.2 - 8.0.0-preview.7.23363.2 - 8.0.0-preview.7.23363.2 - 8.0.0-preview.7.23363.2 - 8.0.0-preview.7.23363.2 - 8.0.0-preview.7.23363.2 + 8.0.0-preview.7.23368.1 + 8.0.0-preview.7.23368.1 + 8.0.0-preview.7.23368.1 + 8.0.0-preview.7.23368.1 + 8.0.0-preview.7.23368.1 + 8.0.0-preview.7.23368.1 + 8.0.0-preview.7.23368.1 + 8.0.0-preview.7.23368.1 4.7.0-3.23314.3 4.7.0-3.23314.3 @@ -168,7 +168,7 @@ 2.0.0-beta-23228-03 - 8.0.0-preview.7.23363.19 + 8.0.0-preview.7.23367.14 7.0.0-preview.22423.2 diff --git a/src/HttpClientFactory/Polly/test/DependencyInjection/PollyHttpClientBuilderExtensionsTest.cs b/src/HttpClientFactory/Polly/test/DependencyInjection/PollyHttpClientBuilderExtensionsTest.cs index 0dc29491984d..9e1fc96b00fc 100644 --- a/src/HttpClientFactory/Polly/test/DependencyInjection/PollyHttpClientBuilderExtensionsTest.cs +++ b/src/HttpClientFactory/Polly/test/DependencyInjection/PollyHttpClientBuilderExtensionsTest.cs @@ -40,16 +40,13 @@ public async Task AddPolicyHandler_Policy_AddsPolicyHandler() { var serviceCollection = new ServiceCollection(); - HttpMessageHandlerBuilder builder = null; + IList additionalHandlers = null; // Act1 serviceCollection.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com")) .AddPolicyHandler(RetryPolicy) - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = PrimaryHandler; - builder = b; - }); + .ConfigurePrimaryHttpMessageHandler(() => PrimaryHandler) + .ConfigureAdditionalHttpMessageHandlers((handlers, _) => additionalHandlers = handlers); var services = serviceCollection.BuildServiceProvider(); var factory = services.GetRequiredService(); @@ -61,7 +58,7 @@ public async Task AddPolicyHandler_Policy_AddsPolicyHandler() Assert.NotNull(client); Assert.Collection( - builder.AdditionalHandlers, + additionalHandlers, h => Assert.IsType(h), h => Assert.IsType(h), h => Assert.IsType(h)); @@ -78,16 +75,13 @@ public async Task AddPolicyHandler_PolicySelector_AddsPolicyHandler() { var serviceCollection = new ServiceCollection(); - HttpMessageHandlerBuilder builder = null; + IList additionalHandlers = null; // Act1 serviceCollection.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com")) .AddPolicyHandler((req) => req.RequestUri.AbsolutePath == "/" ? RetryPolicy : NoOpPolicy) - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = PrimaryHandler; - builder = b; - }); + .ConfigurePrimaryHttpMessageHandler(() => PrimaryHandler) + .ConfigureAdditionalHttpMessageHandlers((handlers, _) => additionalHandlers = handlers); var services = serviceCollection.BuildServiceProvider(); var factory = services.GetRequiredService(); @@ -99,7 +93,7 @@ public async Task AddPolicyHandler_PolicySelector_AddsPolicyHandler() Assert.NotNull(client); Assert.Collection( - builder.AdditionalHandlers, + additionalHandlers, h => Assert.IsType(h), h => Assert.IsType(h), h => Assert.IsType(h)); @@ -119,16 +113,13 @@ public async Task AddPolicyHandler_PolicySelectorWithServices_AddsPolicyHandler( { var serviceCollection = new ServiceCollection(); - HttpMessageHandlerBuilder builder = null; + IList additionalHandlers = null; // Act1 serviceCollection.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com")) .AddPolicyHandler((req) => req.RequestUri.AbsolutePath == "/" ? RetryPolicy : NoOpPolicy) - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = PrimaryHandler; - builder = b; - }); + .ConfigurePrimaryHttpMessageHandler(() => PrimaryHandler) + .ConfigureAdditionalHttpMessageHandlers((handlers, _) => additionalHandlers = handlers); var services = serviceCollection.BuildServiceProvider(); var factory = services.GetRequiredService(); @@ -140,7 +131,7 @@ public async Task AddPolicyHandler_PolicySelectorWithServices_AddsPolicyHandler( Assert.NotNull(client); Assert.Collection( - builder.AdditionalHandlers, + additionalHandlers, h => Assert.IsType(h), h => Assert.IsType(h), h => Assert.IsType(h)); @@ -163,17 +154,13 @@ public async Task AddPolicyHandlerFromRegistry_Name_AddsPolicyHandler() var registry = serviceCollection.AddPolicyRegistry(); registry.Add>("retry", RetryPolicy); - HttpMessageHandlerBuilder builder = null; + IList additionalHandlers = null; // Act1 serviceCollection.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com")) .AddPolicyHandlerFromRegistry("retry") - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = PrimaryHandler; - - builder = b; - }); + .ConfigurePrimaryHttpMessageHandler(() => PrimaryHandler) + .ConfigureAdditionalHttpMessageHandlers((handlers, _) => additionalHandlers = handlers); var services = serviceCollection.BuildServiceProvider(); var factory = services.GetRequiredService(); @@ -185,7 +172,7 @@ public async Task AddPolicyHandlerFromRegistry_Name_AddsPolicyHandler() Assert.NotNull(client); Assert.Collection( - builder.AdditionalHandlers, + additionalHandlers, h => Assert.IsType(h), h => Assert.IsType(h), h => Assert.IsType(h)); @@ -206,7 +193,7 @@ public async Task AddPolicyHandlerFromRegistry_Dynamic_AddsPolicyHandler() registry.Add>("noop", NoOpPolicy); registry.Add>("retry", RetryPolicy); - HttpMessageHandlerBuilder builder = null; + IList additionalHandlers = null; // Act1 serviceCollection.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com")) @@ -216,11 +203,8 @@ public async Task AddPolicyHandlerFromRegistry_Dynamic_AddsPolicyHandler() reg.Get>("retry") : reg.Get>("noop"); }) - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = PrimaryHandler; - builder = b; - }); + .ConfigurePrimaryHttpMessageHandler(() => PrimaryHandler) + .ConfigureAdditionalHttpMessageHandlers((handlers, _) => additionalHandlers = handlers); var services = serviceCollection.BuildServiceProvider(); var factory = services.GetRequiredService(); @@ -232,7 +216,7 @@ public async Task AddPolicyHandlerFromRegistry_Dynamic_AddsPolicyHandler() Assert.NotNull(client); Assert.Collection( - builder.AdditionalHandlers, + additionalHandlers, h => Assert.IsType(h), h => Assert.IsType(h), h => Assert.IsType(h)); @@ -267,16 +251,13 @@ public async Task AddTransientHttpErrorPolicy_AddsPolicyHandler_HandlesStatusCod var serviceCollection = new ServiceCollection(); - HttpMessageHandlerBuilder builder = null; + IList additionalHandlers = null; // Act1 serviceCollection.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com")) .AddTransientHttpErrorPolicy(b => b.RetryAsync(5)) - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = handler; - builder = b; - }); + .ConfigurePrimaryHttpMessageHandler(() => handler) + .ConfigureAdditionalHttpMessageHandlers((handlers, _) => additionalHandlers = handlers); var services = serviceCollection.BuildServiceProvider(); var factory = services.GetRequiredService(); @@ -288,7 +269,7 @@ public async Task AddTransientHttpErrorPolicy_AddsPolicyHandler_HandlesStatusCod Assert.NotNull(client); Assert.Collection( - builder.AdditionalHandlers, + additionalHandlers, h => Assert.IsType(h), h => Assert.IsType(h), h => Assert.IsType(h)); @@ -315,16 +296,13 @@ public async Task AddTransientHttpErrorPolicy_AddsPolicyHandler_HandlesHttpReque var serviceCollection = new ServiceCollection(); - HttpMessageHandlerBuilder builder = null; + IList additionalHandlers = null; // Act1 serviceCollection.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com")) .AddTransientHttpErrorPolicy(b => b.RetryAsync(5)) - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = handler; - builder = b; - }); + .ConfigurePrimaryHttpMessageHandler(() => handler) + .ConfigureAdditionalHttpMessageHandlers((handlers, _) => additionalHandlers = handlers); var services = serviceCollection.BuildServiceProvider(); var factory = services.GetRequiredService(); @@ -336,7 +314,7 @@ public async Task AddTransientHttpErrorPolicy_AddsPolicyHandler_HandlesHttpReque Assert.NotNull(client); Assert.Collection( - builder.AdditionalHandlers, + additionalHandlers, h => Assert.IsType(h), h => Assert.IsType(h), h => Assert.IsType(h)); @@ -353,7 +331,7 @@ public async Task AddPolicyHandlerFromRegistry_PolicySelectorWithKey_AddsPolicyH { var serviceCollection = new ServiceCollection(); var registry = serviceCollection.AddPolicyRegistry(); - HttpMessageHandlerBuilder builder = null; + IList additionalHandlers = null; // Act1 serviceCollection.AddHttpClient("Service") @@ -367,11 +345,8 @@ public async Task AddPolicyHandlerFromRegistry_PolicySelectorWithKey_AddsPolicyH return r.RequestUri.Host; } ) - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = PrimaryHandler; - builder = b; - }); + .ConfigurePrimaryHttpMessageHandler(() => PrimaryHandler) + .ConfigureAdditionalHttpMessageHandlers((handlers, _) => additionalHandlers = handlers); var services = serviceCollection.BuildServiceProvider(); var factory = services.GetRequiredService(); @@ -382,7 +357,7 @@ public async Task AddPolicyHandlerFromRegistry_PolicySelectorWithKey_AddsPolicyH Assert.NotNull(client); Assert.Collection( - builder.AdditionalHandlers, + additionalHandlers, h => Assert.IsType(h), h => Assert.IsType(h), h => Assert.IsType(h)); @@ -435,17 +410,13 @@ public async Task AddPolicyHandlerFromRegistry_WithConfigureDelegate_AddsPolicyH registry.Add>(policyName, RetryPolicy); }); - HttpMessageHandlerBuilder builder = null; + IList additionalHandlers = null; // Act1 serviceCollection.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com")) .AddPolicyHandlerFromRegistry(options.PolicyName) - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = PrimaryHandler; - - builder = b; - }); + .ConfigurePrimaryHttpMessageHandler(() => PrimaryHandler) + .ConfigureAdditionalHttpMessageHandlers((handlers, _) => additionalHandlers = handlers); var services = serviceCollection.BuildServiceProvider(); var factory = services.GetRequiredService(); @@ -457,7 +428,7 @@ public async Task AddPolicyHandlerFromRegistry_WithConfigureDelegate_AddsPolicyH Assert.NotNull(client); Assert.Collection( - builder.AdditionalHandlers, + additionalHandlers, h => Assert.IsType(h), h => Assert.IsType(h), h => Assert.IsType(h)); diff --git a/src/Middleware/HeaderPropagation/test/HeaderPropagationIntegrationTest.cs b/src/Middleware/HeaderPropagation/test/HeaderPropagationIntegrationTest.cs index 00546f93681e..111b692d1e32 100644 --- a/src/Middleware/HeaderPropagation/test/HeaderPropagationIntegrationTest.cs +++ b/src/Middleware/HeaderPropagation/test/HeaderPropagationIntegrationTest.cs @@ -207,10 +207,7 @@ private async Task CreateHost(Action configure, { services.AddHeaderPropagation(configure); var client = services.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com")) - .ConfigureHttpMessageHandlerBuilder(b => - { - b.PrimaryHandler = primaryHandler; - }); + .ConfigurePrimaryHttpMessageHandler(() => primaryHandler); if (configureClient != null) {