Articles Tagged ‘junit5’

Using Throwaway Containers for Integration Testing with Java, JUnit 5 and Testcontainers.

Wednesday, January 30th, 2019

A lot of boilerplate code is written when developers need to test their applications with different connected systems like databases, stream platforms and other collaborators.

Docker allows to handle those dependencies but there is still some glue code required to bind the container’s lifecycle and the configuration to the concrete integration test.

Testcontainers is a testing library that offers lightweight throwaway instances of anything able to run in a Docker container, with bindings to configure the specific containers and also provides wrappers to manage our own custom containers.

In the following short tutorial I am going to demonstrate how to start Apache Kafka as well as a classical Postgresql database from a JUnit 5 integration test.

(more…)

Using JUnit 5 Parameterized Tests, Argument Sources and Converters

Saturday, August 19th, 2017

With JUnit 5 the possibilities to write parameterized tests have changed and improved a lot.

The following short overview covers all new types of possible parameter sources for JUnit 5 tests as well as the new conversion API for test arguments.

In addition we’re showing how parameterized tests were written in JUnit 4.

(more…)

Search
Categories