-2

I have a netcore web service that makes additional calls out to other webservices. One of those other web services is gRPC-based. I would like to write some tests at the protocol level by stubbing out the gRPC-based service with a simulated server.

How can I stub a gRPC or HTTP/2 request using WireMock.NET?

yenta
  • 1,332
  • 2
  • 11
  • 25
  • See following : https://github.com/tomakehurst/wiremock – jdweng Nov 30 '20 at 17:14
  • @jdweng could you please elaborate? – yenta Nov 30 '20 at 21:05
  • Read the features in the link. – jdweng Nov 30 '20 at 22:06
  • @jdweng I re-worded the question, does that make more sense? – yenta Dec 01 '20 at 00:07
  • What would be the difference between a simulated server and the real server? Is it the location of the server or the data? What type of database are you using? Usually a server queries data from a database. So for testing purposes you don't use a real data and instead create a database with test data. Which means you just change the connection string to a test database instead of a real database. – jdweng Dec 01 '20 at 10:37
  • @jdweng The real service is not yet implemented - all we have is the proto file. This particular service performs financial calculations that require gpus on a cloud stack that we don't want to pay for (at least in these tests). Development is being done in parallel. We have several layers of testing set up and for this layer (calling it service tests) we want run tests against an instance of our service with all of it's external service dependencies mocked out. We don't want to mock at the class level, but at the protocol level. – yenta Dec 14 '20 at 11:36
  • So create a set of simple classes for testing. You have a request and get a response back. So send a test response. – jdweng Dec 14 '20 at 12:19

1 Answers1

0

WireMock.NET does not currently support simulating HTTP/2 servers. This would require a change to the library to allow configuring the Protocol on the WireMockServer and a change to the internal ResponseMessage to better support stream bodies and trailing headers.

yenta
  • 1,332
  • 2
  • 11
  • 25