Issue
I am doing a web project rest api in Spring boot and need to write unit test cases. I am confused about to write test cases for http urls using http client, or test cases for @service methods ?
Solution
Usually unit tests cover public methods from @Service annotated class (and other components).
Testing with HTTP client is more like writing integration tests, which cover connection between different systems - just like in the case of HTTP API, that is called either by your different service or by other component independent from your system.
PS: Welcome on StackOverflow, I hope that you will find your answers. :)
Answered By - y434y
Answer Checked By - Gilberto Lyons (JavaFixing Admin)