Hello, im very new to Java and want t olern how to write unit tests for a REST-controller in springboot.
When i google i get two different approaches, either mocking the controller using mock and just calling the methods OR i see the alternative way of using mockMvc and calling the actual endpoint.
Which is the way to go if you want to write "unit test"? Or do you usually do both ways?
Thanks in advance 🙂