What is this SELF in GenericContainer For?

GenericContainer class belongs to TestContainers library, which is used to create a container instance, launch and control it during integration testing. All other TestContainers classes, like MySQLContainer, KafkaContainer, etc, extend from this base class. However, it has a bit weird generic class definition itself as you may notice from below code block. This somehow recursive […]

TestContainers & MySQL Setup Notes

Integration tests are one of the fundamental building blocks of the testing pyramid. By using integration tests, we try to verify if our software components interact with each other and with its third-party external dependencies according to the requirements of the software being written. One type of those external dependencies is called generic third-party dependencies, […]

Weird Rollback Behavior of Spring TestContext Framework

One of the nice features of TestContext module of Spring Application Framework is its ability to run unit tests within a transaction context. By that way, you are able to both execute your persistence operations which usually expect an active transaction to run, and also rollback state changes occur during execution of these persistence operations […]

Integrating JSFUnit To Your Project

Actually I am not a big fun of in-container unit testing approaches. They have longer execution times, e.g. container and database startup, intialization times etc. In addition, they create configuration complexity in terms of packaging of tests and deployment of application together with them. Anyway, recently I needed to examine JSFUnit solution more closely for […]

Run all TestNG tests with just one click inside Eclipse

It is a little bit annoying if you have looked around in eclipse and tried to find a short cut to run all of your tests using TestNG with one mouse click. One way of running TestNG tests is with creating a testng.xml file and defining tests in it. There are several options to define […]

Mocking ResourceBundle

If you want to unit test a method that depends java.util.ResourceBundle, and want to isolate bundle access code with mocking ResourceBundle, using for example, JMock Dynamic Mocking Library, you will face with a restriction, that commonly used methods, such as getString(key) are defined as final in ResourceBundle class. There is no way to extend and […]