Assert no exception is thrown in AssertJ and JUnit 5
It is sometimes necessary to test that a piece of code does not throw an exception or that an exception is caught in another code block, ensuring that the caller …
Coding, Tech & Linux
It is sometimes necessary to test that a piece of code does not throw an exception or that an exception is caught in another code block, ensuring that the caller …
JUnit 5 @CsvSource allows writing parameterized tests without creating a CSV file or writing a method to feed data. However, handling nulls is not provided out of the box and …
Using Mockito annotations in JUnit 5. The latest release of JUnit is not backward compatible and does not work straightforwardly with many testing frameworks such as Mockito. Mockito annotations do …
Besides JUnit, AssertJ is another popular testing framework for Java that provides a fluent API for writing clear and concise test assertions. It improves the readability of test code and …
Running tests against a real database provides more confidence in comparison to an in-memory database such as H2. For that, the Testcontainers library is a wise choice as it provides …
Like any other external dependency, we can write integration tests using Testcontainers for a Spring Boot application. However, unfortunately, Testcontainers does not have any library for Redis, and using Kotlin …