ShiningRush edited a comment on pull request #1318:
URL: https://github.com/apache/apisix-dashboard/pull/1318#issuecomment-761993164


   > Original mock doesn't have the store ability, so we need to provide mock 
data in every unit test.
   
   Yes, this is the job that stub module should do, if you want to reuse stub 
data, you should just extract those data instead of the logic.
   Put the store logic into mock object will cause `Shotgun Surgery` that when 
we change the logic of store, we need also change the mock object's loigc.
   
   >  I think this is more like a fake ETCD and can help we write unit test 
more convenient.
   If you want a fake ETCD, I think we can implement a `MemoryStorage` for 
`GenericStore`.
   
   However, I must point that this way should just be used by integration test, 
because **unit test should be isolated from each other**


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to