When your Java application wants to communicate with a server that used self-signed certificate, you get very often a javax.net.ssl.SSLHandshakeException, because the validation of self signed public key fails. It is possible to ignore this validation. But this is not recommended because of it simplifies a …
Read MoreIn this blog post, I'd like to show how to integrate Testcontainers in Spring Boot tests for running UI tests with Selenium. Why Testcontainers? Testcontainers is a library that helps to integrate infrastructure components like Selenium or databases in integration tests based on Docker Container. It helps to avoid …
Read MoreUsing Testcontainers in Spring Boot Tests For Database Integration Tests
In this blog post I'd like to demonstrate how I integrate Testcontainers in Spring Boot tests for running integration tests with a database. I'm not using Testcontainers' Spring Boot modules. How it works with them, I will show in a separate blog post. All samples can be found on GitHub. Why Testcontainers? …
Read MoreThis blog post wants to show another approach how to implement the Strategy Pattern with dependency injection. As DI framework, I choose Spring framework From Wikipedia Firstly, let's have a look how the Strategy Pattern is implemented in the classic way. As starting point, we have a HeroController that should add …
Read MoreI create a sample Groovy project for Maven, that mixes Spock tests and JUnit 5 tests in one project. In the next section I'll describe how to set up such kind of Maven project. Enable Groovy in the Project First at all, you have to enable Groovy in your project. One possibility is to add the GMavenPlus Plugin to your …
Read MoreThis post demonstrates how JUnit 5 can be used in pre-Java 8 projects and explains why it could be a good idea. JUnit 5 requires at least Java 8 as runtime environment, so you want to update your whole project to Java 8. But sometimes there exists reason why you can't immediately update your project to Java 8. For …
Read MoreIf you introduce code formatting rules retroactively, you have to solve the problem how to format existing code base according to the new formatting rules. You could checkout every code repository one by one in your IDE and click on Autoformat the whole project. But this is boring and waste of time. Fortunately, …
Read MoreJersey has a great possibility to write integration test for REST-APIs, written with Jersey. Just extend the class JerseyTest and go for it. I ran in an issue, where I had to mock a SecurityContext, so that the SecurityContext includes a special UserPrincipal. The challenge is that Jersey wraps the SecurityContext in …
Read MoreGenerate P2 Repository From Maven Artifacts In 2017
Sep 22, 2017 · 4 min read · eclipse rcp equinox maven repository maven tycho osgi p2 p2-repository ·Some years ago, I wrote a blog post about how to generate a P2 repository based on Maven artifacts. That described approach is obsolete nowadays and I'd like to show a new approach that is based on the p2-maven-plugin that was created to solve exactly this problem. P2-Maven-Plugin Integration in Maven Build Life Cycle …
Read MoreIf you want to install Tomcat on Windows system as a service, you'll get the recommendation to use the 32-/64-Bit Windows Service Installer. If you want to install the Tomcat manually, it's fine. But you can't use this installer for an automatic installation and configuration of Tomcat, because the installer is …
Read More