Integration Testing With Spring – Avoiding Problems
We already know that Spring is complex. And we’ve just scratched the surface. One of the problem with complex frameworks is that they do so much, that when something goes wrong they are not that smart about analyzing the situation. And that really gets in our way of doing actual Read more…
Integration Testing with Spring – Nested Configurations
Let’s dig deeper into configurations for integration tests in Spring. We’ll start with a nested integration context example, for a class (that might be a test class, because that’s our main focus). While we can use @Import, if we set up one-time configuration, it could be nested in the test class. Read more…
Integration Testing with Spring: A Custom Configuration
Here’s the situation: We have a couple of configuration files we use for integration tests. Each of them is a different set of real and mock objects. Some of the objects have behaviors set on them (using Mockito.when) in the configuration classes. Now, one of the integration tests need one Read more…
Integration Testing with Spring – Testing A REST API
After we understand how to use mocks in Spring in integration tests, let’s take a look at a setup for testing a REST service that uses a dependency we want to mock. API testing is a usual integration test scenario, and with those, we might need to mock dependencies buried Read more…