In the following article, apart from providing two solutions to the title problem, we will also talk about a few side topics. I find them worth discussing as they explain the specific behavior of SpringBoot and the H2 database when running JUnit tests.
The following video shows how to create both client and server scripts for FiveM that allows you to pass data from the client through the server and to store it in MySQL database
In the first part of the guide you get know the right solution to implement thread safe singleton in Java. Then I'm going to explain to you what's wrong with the most common singleton implementation and why it is not thread safe.
Have you ever wondering how to make your application travel in time? If you have, let me tell you that’s great because in the following tutorial I’m going to show you in the real examples how to manage time for all of three test layers - unit tests, integration tests and end-to-end testing.
The following guide explains how to use mock in Spock Testing Framework in a proper way to get rid of unnecessary problems like NullPointerExceptions and InvalidSpecException when you try stubbing instead of mocking.
From the following guide you will learn how to configure maven project to work with Spock Testing Framework in both cases: standard Java maven project and SpringBoot maven project.
Both @PostConstruct and @PreDestroy annotations (often used in spring applications) are located in java.xml.ws.annotation package which is a part of Java EE module. J2EE has been deprecated in Java 9 and it’s scheduled to be removed…
There are situations in witch you need to access Spring ApplicationContext or any other Spring bean from a static method. At the beginning I would like to emphasise, that wiring a…