Writing parameterized tests for Junit 5?

As a software engineer, I often encounter situations where I need to run the same test logic with different input values. Repeating the same test with minor variations not only clutters your test classes but also violates the DRY (Don't Repeat Yourself) principle.

That’s where parameterized tests come into play. Since JUnit 5, writing these tests has become much easier and cleaner. In this post, I’ll walk you through how to use parameterized tests effectively with JUnit 5.

Read more

How to logging SOAP requests and responses in Spring Boot?

When working with SOAP web services in a Spring Boot application, it’s often necessary to log incoming and outgoing SOAP messages for debugging, auditing, or monitoring purposes. Unlike REST APIs, where logging can be handled easily with filters and interceptors, SOAP requires a specialized approach.

Why Log SOAP Messages?

  • Debugging: Helps developers diagnose issues by capturing full request and response messages.
  • Auditing: Ensures compliance by keeping a record of exchanged messages.
  • Monitoring: Allows tracking of service interactions in production.

Implementing a SOAP Logging Handler

Spring Boot provides integration with SOAP web services using JAX-WS. To log SOAP requests and responses, we can implement a custom SOAPHandler. Here’s a simple SoapLoggingHandler that captures both inbound (responses) and outbound (requests) SOAP messages:

Read more

What is zero-copy?

Efficiency is a crucial factor that determines system performance in the modern digital environment, which is marked by exponential data expansion. Conventional data transfer methodologies, which necessitate the central processing unit (CPU) to execute multiple data copy operations, impose significant overhead, thereby impeding performance. The concept of ‘zero-copy’ emerges as a pivotal optimization strategy, designed to mitigate these inefficiencies by eliminating redundant data replication within the system. This paradigm change eliminates the need for the CPU to act as an intermediary and significantly lowers latency by enabling direct data flow between external devices and memory.

Read more

The world’s simplest database

With their sophisticated query engines, transaction management, and indexing algorithms, databases are frequently regarded as complex systems. What if I told you that it is quite simple to write a database from scratch, what would you think? In this post, we’ll use only simple bash functions to reduce databases to their bare essentials: storing, retrieving, and modifying data.

This lightweight, basic method will provide you with a new perspective, regardless of whether you’re searching for a fun weekend project or simply want to comprehend the fundamental ideas behind databases. Let’s get started!

Read more