Being able to define extension functions to classes that belong to third-party libraries looks very nice at the first point. However, they might become a road blocker during your unit testing, if you are working with Mockito as the mocking library. Let’s talk about the problem using an example, let’s write an extension function to […]
Category: Kotlin
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 […]