Testing Spring Boot Kafka with Testcontainers

In this tutorial, I will explain how to do integrating testing of spring boot , kafka applications using Testcontainers. In my previous blog post I have covered how to write Kafka producer and consumer application using Spring Boot framework. Now, we will write integration tests for testing the logic of producer and consumer application and…

Spring Boot integration testing with Testcontainers

Springboot provides excellent support for unit testing and integration testing. I have covered how to do unit testing for Springboot controllers in various ways in one of my previous articles. While doing unit testing we try to test a single method while mocking all the dependencies. While doing integration testing we see that interaction between…

JUnit : Handling System and Environment properties in unit testing

It can be hard to automate unit testing when the code depends on the environment or system properties. In this blog post, I will show you how to test the code which depends on the System or Environment properties using 2 test packages. System Stubs JUnit Pioneer Handling Environment Variables I am going to use…