Demystifying Dependency Injection - What It Is and Why It Matters

This article is part of a series that goes in depth on Dependency Injection (DI). In this series, we learn what DI actually is and why we would want to use it. Once you start digging into it, you will encounter quite a few related terms, which will be explained. There are also multiple ways to inject dependencies, with even more names and smaller variations. We will cover those and also explore the different ways dependencies can be wired and which frameworks can help us do that. ...

January 19, 2026 · Last updated on January 19, 2026

Artikel "Lokales Testen von AWS Serverless Lambda-Funktionen" in der Java Aktuell 03-2023

Mein Artikel ist in der neusten Ausgabe der Zeitschrift Java Aktuell zu finden. Hier ist eine kurze Zusammenfassung des Inhalts: Das Testen von Microservices wird mittlerweile hinreichend praktiziert. Bei Serverless Functions wie AWS-Lambdas wird meist nur manuell nach einem Deployment getestet, speziell wenn es um die Logik geht, die durch AWS (Amazon Web Services) bereitgestellt wird. Dabei ist es auch möglich, die Anwendung automatisiert lokal hochzufahren und zu testen. Aber wie geht das in einem (relativ) geschlossenen System wie der AWS-Cloud? Durch den geschickten Einsatz von LocalStack, Testcontainers und dem AWS-SDK ist es unter anderem möglich, Component-Tests automatisiert auszuführen und etwaige Fehler in der Benutzung der Lambda-Funktion aufzudecken. ...

April 25, 2023 · Last updated on April 25, 2023

Recording and Slides of My Talk "Local testing of AWS serverless lambda functions" at an OpenValue Meetup

I really enjoyed the evening and the opportunity to speak at the meetup from OpenValue, thank you very much. Special thanks to Sebastian Konieczek for organizing the meetups. Abstract There are a lot of resources and best practices about testing of microservices. Serverless functions like AWS Lambdas are still mostly tested manually after a deployment, especially concerning logic provided by AWS. Though it is possible to start the application locally and even test it. But how does it work for a (relatively) closed system like the AWS cloud? Through smart usage of LocalStack, TestContainers and the AWS SDK it is possible to automatically execute component tests and uncover possible errors in the usage of the lambda function. ...

November 10, 2022 · Last updated on November 10, 2022

Accepted as a JavaLand newcomer speaker

Even with some experiences in microservices, switching into a cloud project was not easy all the time. The first time I started to test my implementations I struggled a lot, especially while dealing with AWS lambdas. There is not much information out there about it and a lot of things you might find are plain wrong or not functional at all. That is why the talk will deal with the local testing of AWS serverless lambdas. In the end I hope to make lots of developer’s life easier by providing a useful resource about testing. ...

October 7, 2022 · Last updated on October 7, 2022

Receiving mails in Java with IMAP or POP3

This example shows you how to receive mails in Java either using the IMAP or the POP3 protocol. The SSL encrypted variants IMAPS and POP3S are also supported. Received mails will be set to read, which means that you will only receive the latest ones. I will also give some hints about how to handle incoming mails concerning application security. Remember that you should always sanitize user inputs. Receiving mails You need to use to the following import statement import javax.mail.*; to be able to connect mail servers. The constructor of the client is straightforward. It is simply used to pass and store some values into fields, which are then used later on. We are interested in the protocol, host, port user and password. Valid values for the protocol are imap, imaps, pop3 and pop3s. ...

May 30, 2022 · Last updated on January 23, 2025

Recording and Slides of My Talk "Testing email with GreenMail, a mock mail server" at an OpenValue Meetup

I really enjoyed the evening and the opportunity to speak at the meetup from OpenValue, thank you very much. Special thanks to Bert Jan Schrijver for organizing the meetups. Unfortunately the audio quality is not as good as I hoped it would be. Abstract Sending emails or receiving and processing emails is something that a lot of applications feature to their users. But how do you know that the code doing this actually works? Even though email integrations are widespread functionalities, only few projects have a clear process of how to test them. Why? Because testing is sometimes challenging and people are afraid of accidentally leaking emails to real mail servers. Often these processes also do not offer a great developer experience. GreenMail is an open source, intuitive and easy-to-use suite of mock email servers for testing purposes, which aims to solve these problems. In this presentation you will learn how to leverage GreenMail to manually and integration test your email functionality while at the same time offering a great development experience. ...

June 5, 2021 · Last updated on June 5, 2021

Manually testing email notifications with GreenMail mock mail server

Whenever developing an application I aim to get local and testing environment as close to production as possible without neglecting elementary things like privacy and security. This gives an advantage when implementing new features. You get the same user experience on your local device. This enables you to find troublesome or unclear sections. It also lowers the barrier for manual testing, which results in more and higher quality feedback from everyone (not only developers) involved in the project. ...

February 16, 2021 · Last updated on July 1, 2021

Generating generic fields in JCodeModel

I recently wrote an article about generating enums with JCodeModel. Due to the lack of documentation of JCodeModel using it can become very time consuming. I had to put in a lot of time to research a lot of basic stuff. This article will show you how to declare and assign generic fields. Getting started As before to get started you have to create an instance of JCodeModel. You will need this object to generate your classes. ...

October 14, 2020 · Last updated on October 14, 2020

Generating Enums in Java with JCodeModel

I have recently been in the need to generate my own Java classes from csv input. Obviously JCodeModel is your first choice, but it lacks some examples. There is a nice article by Kevin Sookocheff which covers the basic stuff, but it is missing some more in depth examples. In case you are in need to generate Enums - like me - the next following lines might be interesting for you. ...

October 11, 2020 · Last updated on October 11, 2020