That's an interesting one. I'd be interested to be other people's responses. In my own experience I had to deal with REST API's backed by a relational databases in a multithreaded environment (
Tomcat). Some operations were a bit tricky, like
- retrieve something from the database
- if already exists update
- else create
Which would have been relatively easy with native queries but using ORM we had to deal with potential concurrency issues when 2 same requests came in at roughly the same time. So even if the code itself was not using concurrent API's, we had to deal with this race condition due by a shared resource (the database). Due to its remote nature, the network latency exacerbates the race conditions.
So essentially we ended up writing
junit tests that would bootstrap our Spring application and start hammering in some kind of deterministic way with a number of threads, to make sure these endpoints were solid enough. Something very simple with a RestAssured client and a CountDownLatch and some proper try/catch/finally.