Hello,
we face a very rare situation : in one of our app, we need to embed the mockwebserver library inside the app itself, not in its tests. Our client wants an app that can be used in a "demo mode" that will return mocks of webservices (static json files mostly). Thus we embedded the mockwebserver inside the app to replay the mocks.
But we are now facing a problem : the mockwebserver can only be tested via the network : by sending real requests and checking if the results match expected json responses.
Nevertheless, it would be possible, by some minor changes in the architecture, to make the mockwebserver testable directly without using the network.
For us, only one of them would be interesting : being able to test a dispatcher. To achieve this, it would be enough to have 1) a public constructor for RecordedRequest or 2) make the class non final.
Would it be possible for the mockwebserver team to provide us with a public constructor inside RecordedRequest so that we can create custom Requests, inject them in the dispatcher and test if our dispatcher returns the appropriate response ?
That's really an urgent need for us. If the project would have been on github we would have been pleased to submit a pull request for this. Without this change, we will have to fork mockwebserver and we would prefer not too as your lib is really great and we would like to keep it in sync with your great work.
Thanks in advance, Stéphane
Comment #1
Posted on Jan 25, 2013 by Massive BearIf you insist, I'll use my time machine and fix your problem 24 hours before you reported it. https://code.google.com/p/mockwebserver/source/detail?r=33
Comment #2
Posted on May 21, 2013 by Happy DogComment deleted
Comment #3
Posted on May 21, 2013 by Happy DogComment deleted
Comment #4
Posted on May 21, 2013 by Happy DogThx ! :)
Status: Fixed
Labels:
Type-Defect
Priority-Medium