简体   繁体   中英

Mock data for client calling to spring web service

I need to get mock data for client calling to spring restful web services. I know unit testing purpose we can use mock. but my case is not the testing.

Use hard coded data, or external data file, or external data source to store mock data. I understand the need to host a service that responds but may not be fully wired, to allow early integration with downstream clients. These are the techniques I use, each have pros and cons.

Hard coded data - as you say, is not intuitive or easy to change. Okay for temporary state.

External data file - able to update dynamically as needed

External data source - able to create multiple scenarios with dynamic mock payloads, and change on demand

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM