DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library
Core Badge
Avatar

Arnošt Havelka

DZone Core CORE

Development Team Lead at Deutsche Börse

Prague, CZ

Joined Oct 2008

About

Passionate SW engineer with 20+ years experience from different projects. My current interests are clean code & clean architecture with a focus on QA (tests and automation)

Stats

Reputation: 1132
Pageviews: 282.0K
Articles: 21
Comments: 17

Expertise

Testing, Tools, and Frameworks Expertise Icon

Testing, Tools, and Frameworks

  • Articles
  • Comments

Articles

article thumbnail
Set Up Spring Data Elasticsearch With Basic Authentication
Guide to configure SSL communication with Elasticsearch via Spring Data Elasticsearch. Additionally, the communication is secured with BASIC authentication.
October 27, 2025
· 2,066 Views
article thumbnail
Introduction to Spring Data Elasticsearch 5.5
Getting started with the latest version of Spring Data Elasticsearch 5.5 and Elasticsearch 8.18 as a NoSQL database for our data storage.
October 10, 2025
· 2,975 Views · 2 Likes
article thumbnail
Demystifying Sorting Assertions With AssertJ
Know the options for sorting assertions in AssertJ, including ascending/descending order, multiple attributes, null handling, and case-insensitive sorting.
February 5, 2025
· 8,443 Views · 3 Likes
article thumbnail
Using Lombok Library With JDK 23
In this brief tutorial, learn how to avoid compilation errors when using the Lombok library with Java 23.
October 1, 2024
· 18,132 Views · 11 Likes
article thumbnail
Hints for Unit Testing With AssertJ
Discover a couple of tips and tricks for writing better unit tests with the AssertJ framework. Every recommendation includes a practical demonstration.
February 26, 2024
· 6,456 Views · 8 Likes
article thumbnail
Querydsl vs. JPA Criteria, Part 6: Upgrade Guide To Spring Boot 3.2 for Spring Data JPA and Querydsl Project
In this tutorial, learn more about a solution for two issues caused by the upgrade to the latest Spring Boot 3.2 and Spring Data JPA.
January 24, 2024
· 6,628 Views · 2 Likes
article thumbnail
Demystifying Static Mocking With Mockito
Many times, we have to deal with a situation when our code invokes a static method. Discover a possible solution for mocking static methods with Mockito.
November 28, 2023
· 18,940 Views · 4 Likes
article thumbnail
Querydsl vs. JPA Criteria, Part 5: Maven Integration
The first part takes a look at the Maven setup of Querydsl framework with Java EE and Jakarta. The second part sheds light on Querydsl solution with Maven classifiers.
November 3, 2023
· 10,048 Views · 4 Likes
article thumbnail
Querydsl vs. JPA Criteria, Part 4: Pagination
Sometimes your data is too large to be shown in GUI. Let's shed light on a pagination feature with JPA Criteria and Querydsl framework.
June 21, 2023
· 14,014 Views · 5 Likes
article thumbnail
Upgrade Guide To Spring Boot 3.0 for Spring Data JPA and Querydsl
Learn more about the adaptation to the latest Spring Boot 3.0.2 and Spring Data JPA 3.0.1.
February 22, 2023
· 25,660 Views · 3 Likes
article thumbnail
Upgrade Guide To Spring Data Elasticsearch 5.0
Learn about the latest Spring Data Elasticsearch 5.0.1 with Elasticsearch 8.5.3, starting with the proper configuration of the Elasticsearch Docker image.
January 26, 2023
· 12,138 Views · 2 Likes
article thumbnail
Querydsl vs. JPA Criteria, Part 2: Metamodel
In part two of a series dedicated to the Querydsl framework, this tutorial demonstrates how to use a metamodel with JPA Criteria and Querydsl.
October 17, 2022
· 8,557 Views · 4 Likes
article thumbnail
Pagination With Spring Data Elasticsearch 4.4
Explanation of the pagination options within Spring Data Elasticsearch 4.4 using Elasticsearch 7 as a NoSQL database.
September 27, 2022
· 13,519 Views · 1 Like
article thumbnail
Introduction: Querydsl vs. JPA Criteria
This article presents an introduction to the Querydsl series with the goal to highlight the difference from JPA Criteria.
Updated August 9, 2022
· 19,412 Views · 8 Likes
article thumbnail
Using Watermarks in iText 7
This tutorial shows how you can add watermarks to PDF using the iText7 library.
February 26, 2022
· 13,077 Views · 2 Likes
article thumbnail
Smart Dependency Injection With Spring: Assignability (Part 2 of 3)
In part two of this three-part series, learn about using inheritance to simplify injecting beans with Spring Framework.
Updated November 9, 2021
· 15,795 Views · 8 Likes
article thumbnail
Smart Dependency Injection With Spring: Overview (Part 1 of 3)
This article covers the basics of DI supported by the Spring Framework, including configuration types, injection variants, and how to inject different types.
Updated November 9, 2021
· 16,203 Views · 14 Likes
article thumbnail
Smart Dependency Injection With Spring - Generics (Part 3/3)
This article is the last one in my mini-series dedicated to dependency injection with the Spring framework. Using generics to simplify injecting beans with Spring framework.
November 9, 2021
· 16,171 Views · 7 Likes
article thumbnail
Introduction to Spring Data Elasticsearch 4.1
Getting started with the latest version of Spring Data Elasticsearch 4.1 using Elasticsearch 7 as a NoSQL database.
June 13, 2021
· 23,096 Views · 9 Likes
article thumbnail
Using Barcodes in iText 7
A developer shows us how to use Java to create several different types of bar codes and explains how these barcodes work to encode data.
January 29, 2021
· 10,677 Views · 1 Like
article thumbnail
Introduction to iText 7
Getting started with the latest version of iText 7, with instructions on generating PDF content and then stylizing it to suit your needs.
December 12, 2020
· 19,981 Views · 4 Likes

Comments

OpenAPI From Code With Spring and Java: A Recipe for Your CI

May 20, 2026 · Roman Dubinin

Well, this represents the contract last approach. It has so many issue it's not worth to go with. Even so it's easy, I must admit it. IMHO the best way is to use the contract last approach -> starting the generation from YAML file.

Name just couple issues from top of my head:

- missing HTTP headers -> which are usefull for the clients for the correct calls

- method name conflicts when you want single YAML file (for GUI) from several BE modules

- pagination -> YAML is not generated properly

Hexagonal Architecture: A Lyrics App Example Using Java

Mar 13, 2025 · Joao Esperancinha

It's a pretty good article, I like it. However, I have couple comments for improvement:

1. you mentioned to usage of H2, but you use Postgresql at the end

2. you are using Spring Boot 2.6.x, but I would expect 3.4.x now

3. you defined many dependencies which can be managed by Spring Boot in order to simply Maven (Mockito, JUnit, etc.)

Demystifying Static Mocking With Mockito

Sep 12, 2024 · Arnošt Havelka

see https://stackoverflow.com/a/78976735/7190169 -> not helpful so far :-)

Migrating From Lombok to Records in Java

Jan 02, 2024 · Fernando Boaglio

Good article, but IMHO it's still not time for this (to replace Lombok with Records). There is still too many code boilerplate. I recommend to check https://dzone.com/articles/records-vs-lombok?edition=722502

Querydsl vs. JPA Criteria, Part 5: Maven Integration

Nov 07, 2023 · Arnošt Havelka

Sorry, but how is your comment relevant to this article?

How To Verify Database Connection From a Spring Boot Application

Sep 22, 2023 · Jennifer Reif

for "... using a different database for production than in development ...") well. it depends on many aspects, but believe me we are not brave. Our goal is to have the development smooth, efficient and reliable. Therefore, we have many tests for PROD technologies as well. However, as most of us have many environments before going to PROD where tests are not applicable it seems not efficient to me.

BTW have you considered Spring Actuator? It provides the same feature out of the box -> see e.g. Database Health Indicator part in https://reflectoring.io/spring-boot-health-check/.

How To Verify Database Connection From a Spring Boot Application

Sep 13, 2023 · Jennifer Reif

Nice article, but I have 2 comments:

1. I prefer to use line numbers from article instead of GitHub -> it's hard to see what you are referring to ;-)

2. I don't think the test class is the best solution. Let's imagine you have a different DB provider in tests then in runtime. We use H2 for tests and Oracle for runtime. Such test would be useless to us :-). It depends on the specific project & solution, that's for sure.


Stop Using Spring Profiles Per Environment

Mar 31, 2023 · Bukaj Sytlos

> you could use any of the variations in any environment if you want, right?
TEST & PROD environments use strictly the application server. But it's not effective for the local development to need to start AS, deploy application, etc. Instead, we can run our application as standalone application in different configuration / profile. I'm not talking about features, but dependencies -> e.g. we use H2 database in MEM profile, but Oracle in the rest.

Is it clearer?

Stop Using Spring Profiles Per Environment

Mar 31, 2023 · Bukaj Sytlos

Well, we use profiles to run our application in different setup -> similar to the test case mentioned by you. Except test we also use MEM (a standalone JAR with all resources embedded inside), FAT (a standalone JAR with real resources) and AS (just WAR to be deployed to application server). By resources I mean database, AMQ, LDAP, etc.

It's not always easy to maintain it, but it really simplies our development life ;-).

10 Most Popular Frameworks for Building RESTful APIs

Feb 15, 2023 · Derric Gilling

for Spring Boot) it supports more languages -> also Kotlin & Groovy. See https://start.spring.io/

How To Validate JSON Request Body in Spring Boot

Nov 03, 2022 · Seun Matt

Evidently we honor different aspects/approaches. I wish you to find users for your validator.

How To Validate JSON Request Body in Spring Boot

Nov 02, 2022 · Seun Matt

for "you don't have to create multiple DTOs or litter your code with annotations ") well, it's probably just a matter of prefernce. I prefer annotations more -> to have all definitions at single place.

for "when you want to apply more than one rule to the same field. ") Sorry, I don't understand.

for "I don't see how it is "bad" for testing in the sense that ") The static methods are hard to mock.

How To Validate JSON Request Body in Spring Boot

Nov 02, 2022 · Seun Matt

what's the benefit comparing javax validation? It seems better and more standard way. Spring Boot uses it natively and it's not using static approach -> it's "bad" for testing.

Introduction: Querydsl vs. JPA Criteria

Aug 08, 2022 · Arnošt Havelka

Good catch of my typo. Thanks!

Autowiring in Spring

May 24, 2022 · Lindsay Burk

I recommend to avoid using @Autowired annotation and rather use constructor injection without it. I got this recommendation on Spring certification training. It promotes independence and testability.

Note: There are more wiring possibilities. I wrote about them e.g. here https://dzone.com/articles/smart-dependency-injection-with-spring-overview.

Smart Dependency Injection With Spring - Generics (Part 3/3)

Nov 09, 2021 · Arnošt Havelka

I believe so. We are used to use generics anyway. I use this approach a lot. It simplify the usage when I want just a specific bean.

Smart Dependency Injection With Spring: Overview (Part 1 of 3)

Oct 14, 2021 · Arnošt Havelka

correct! It's fixed now.

User has been successfully modified

Failed to modify user

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook