Testing Jakarta EE REST APIs with Mockito and JUnit 5

Here’s the revised version using @ExtendWith and @InjectMocks for CDI-style mocking: Testing Jakarta EE REST APIs with Mockito and JUnit 5Discover how to test Jakarta EE 10 APIs without a server using Mockito’s dependency injection and JUnit 5 extensions. 1. Maven Dependencies Add these testing frameworks to your pom.xml:

2. REST Resource with CDI … Read more

The Ultimate Jakarta EE 10 Tutorial for Java Developers

Introduction to Jakarta EE 10 Overview of Jakarta EE 10 as the Evolution of Java EE Jakarta EE 10 marks a significant milestone in the evolution of enterprise Java, representing both a technological and organizational shift from its predecessor, Java EE. Now stewarded by the Eclipse Foundation, Jakarta EE 10 introduces new features, modernizes the … Read more

Text Search With Hibernate Search And Spring Boot

In modern application development, efficient search functionality is no longer a luxury – it’s a necessity. Whether you’re building an e-commerce platform, a content management system, or a knowledge base, the ability to quickly find relevant information can make or break user experience. In this guide, we’ll implement a production-ready search solution using Spring Boot … Read more

How to Secure REST APIs with Open Liberty and Jakarta EE: JWT Authentication Tutorial

This tutorial guides you through building a secure REST API using Jakarta EE, Java 21, Open Liberty, and JWT (JSON Web Tokens) for authentication. We’ll use CDI (Contexts and Dependency Injection) for dependency management, a Java record for the data model, and JUnit 5 with JerseyTest (using Grizzly to emulate GlassFish) for integration testing. Additionally, … Read more

Deep Dive into Java Object Mapping Frameworks

In Java development, especially within layered architectures, translating data between different object models (like database Entities and API DTOs) is a frequent task. Doing this manually involves writing repetitive, error-prone boilerplate code (getters/setters). Java Object Mapping frameworks automate this process, saving time, reducing errors, and improving code maintainability. Lets five popular mapping frameworks: MapStruct, ModelMapper, … Read more

Mastering String Concatenation in Java: A Comprehensive Guide with Examples

In Java, manipulating strings is a fundamental task, and joining them together – a process known as concatenation – is one of the most common operations. Whether you’re building user messages, constructing file paths, generating SQL queries, or formatting output, you’ll inevitably need to combine strings. Java offers several ways to achieve string concatenation, each … Read more