How to execute the program
chmod a+x run.sh
./run.sh
- Yes, I didn't make UserClient as executable class, it would make little complicated to test it
- In Spring application, It is generally preferable not-to-test the entry point, hence entry point is "com.modern.Main"
List of tasks, how I did it, and time taken
- Initially followed the guideline https://spring.io/guides/gs/reactive-rest-service/
- Hit with netty-DNS error, and googled and updated dependency with classifier for Mac-M1 processor
- Wasted time in Intercepting WebClient Junit Test and I tried to intercept the request and produce response (without mockserver)
- After 2hrs, I gave-it-up, and fallen back to time-tested mock web server
- I had other choice to use MockBean and expect the API, but generally I felt mocking API is very ugly and useless for my work
- Too much of mock-api eventually becomes useless, I am not able to reproduce production problems using mock-api heavy test-cases
- 30 Minutes with mock-test and mock-web-server
- Add bells and whistles - 45 minutes
- run.sh
- Update Junit failure message
- Test with wrong url
- Answer the question