mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
PM-10600: HttpClientFactory fixture returns the same HttpClient instance.
The IHttpClientFactory.CreateClient(string name) needs to return different HttpClient instances in case there are multiple clients to be created. This have been issue for BaseIdentityClientService where the HttpClient is modified with BaseAddress, causing issues.
This commit is contained in:
parent
b19f85e4db
commit
676f10b832
@ -18,7 +18,7 @@ public class HttpClientFactoryBuilder : ISpecimenBuilder
|
||||
{
|
||||
var handler = context.Create<MockedHttpMessageHandler>();
|
||||
var httpClientFactory = Substitute.For<IHttpClientFactory>();
|
||||
httpClientFactory.CreateClient(Arg.Any<string>()).Returns(handler.ToHttpClient());
|
||||
httpClientFactory.CreateClient(Arg.Any<string>()).Returns(_ => handler.ToHttpClient());
|
||||
return httpClientFactory;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user