In 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 MoreFrom a certain point on, an application has to be configurable. Spring Framework has a nice auxiliary tool for this issue since the first version 0.9 , the class PropertyPlaceholderConfigurer and since Spring Framework 3.1 the class PropertySourcesPlaceholderConfigurer. When you start a Google search for …
Read MoreThis post describes how to set up a Maven project for a Spring web application with Hessian Service. It also shows how to set up the deployment for exposing the Hessian service and how to set up a client to consume the Hessian service. The Spring Framework version is 3.1.1.RELEASE and the Hessian version is 4.0.7. …
Read MoreTo read resources from classpath, you can use the Spring class ClassPathResource. The constructor with one argument reads only resources from file system. But sometimes you want to read a resources from a jar file in the classpath. For this case, you must build an own URLClassLoader from the URL of the jar file and use …
Read More