Unit tests vs integration tests with Spring

前端 未结 7 796
清酒与你
清酒与你 2020-12-07 17:27

I\'m working on a Spring MVC project, and I have unit tests for all of the various components in the source tree.

For example, if I have a controller HomeContr

7条回答
  •  生来不讨喜
    2020-12-07 18:28

    the difference between unit test and integration test is , unit test does not necessarily load your context, you are focusing on the code which you have written - it works fails fast , that is with and without exceptions, by mocking any depends calls in it. But in case of integration tests , you load context and perform end to end test like actual scenarios.

提交回复
热议问题