![]() ![]() It takes time to start the Spring Context. Even complex unit tests on obsolete hardware will still complete sub-second. ![]() They are a necessity.īut compared to unit tests, integration tests are slooooYour typical unit test will execute in a fraction of a second. There is certainly a role for integration tests. This is not to say integration tests are bad. Rather than using the real services, you can use Mockito mocks and spies to keep your tests unit tests and avoid the overhead of running integration tests. Even if you’re just using the Spring Context to auto-wire dependencies, your test is an integration test. In service layers, I’ve seen tests referred as unit tests, but written with dependencies on the actual service, such as a database, web service, or some message server. I have met many developers who refer to tests as “Unit Tests” when they are actually integration tests.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |