How to do micro service integration test
Hi @devdigital I am now contribute a web service which combine mvcclient and identity server. But I can't do test with two server. for example: Used httpclient sent request to the client, then client request token from idserver. My sample code reference this issue: https://github.com/IdentityServer/IdentityServer4/issues/2861 which use two customize WebApplicationFactory. The Author of identity server tell me that I can using your project to do that. But I don't know how to do this.Because your sample code in the readme show the client is not match my mvcclient project.
It seem like that use this to solve it:
using (var client = clientFactory
.WithClientId(clientId)
.WithClientSecret(clientSecret)
.Create(server))
{
var response = await client.GetToken();
Assert.Equal(HttpStatusCode.OK, response.HttpStatusCode);
}
I will try it later,now I use the latest version of asp.net core 2.2 and the newest idserver.It can not initial the factory (throw exception).Maybe I 'll create another new issue ,So close this first.
It's seem like that after fix this issue to continue the micro services work: https://github.com/devdigital/IdentityServer4TestServer/issues/22