Hexagonal Architecture With Spring Boot

A practical, hands-on guide to building a Spring Boot application with Hexagonal Architecture. The article walks through separating business logic and infrastructure into modules, implementing ports and adapters, and testing the system with fast acceptance, integration, and end-to-end tests.

Software Design

Hexagonal Architecture Explained

Hexagonal architecture, introduced by Alistair Cockburn, separates business logic from infrastructure using ports and adapters. This article explores the limitations of traditional layered architecture, explains how hexagonal architecture applies dependency inversion, and shows how to implement and test applications in isolation for better maintainability, flexibility, and long term code quality.

Software Design

Making Developer Interruptions Less Disruptive

Developers often see interruptions as the enemy of productivity, but this article challenges that assumption. It explores flow state, work in progress, and context switching, then explains how pair programming and mob programming can reduce disruption, improve collaboration, and increase overall team performance despite frequent interruptions.

Productivity

Testing Spring Security

This article explains how to test authentication and authorization in Spring Boot applications, covering both MVC and reactive WebFlux. It shows how to secure endpoints, simulate different user roles, handle CSRF protection, and verify access for authorized and unauthorized users. It also covers strategies for unit, integration, and end-to-end testing, along with tips for troubleshooting security issues.

Testing

Introduction to Testing Spring Boot Applications

This article provides an introduction to testing Spring Boot applications. It covers the basics of unit testing with JUnit and Mockito, testing slices of the application, and full integration tests. It offers a starting point for writing effective, maintainable tests and understanding the tools and strategies available in Spring Boot.

Testing

Spring Boot Testing Strategy

This article outlines a practical Spring Boot testing strategy, focusing on writing fast, reliable, and expressive tests. It covers using mocks wisely across architectural boundaries, writing narrow integration tests for external interactions, simulating dependencies locally, and keeping code maintainable through clear separation of logic and infrastructure. The approach balances unit, integration, and broader tests for effective coverage.

Testing

Spring Boot Integration Testing With @SpringBootTest

This article explores integration testing in Spring Boot, including testing in mock environments, running a real server for end-to-end tests, simulating external dependencies, managing test data, and configuring the test setup for speed and reliability.

Testing

Testing Spring Boot WebClient With MockWebServer

This article explains why mocking WebClient directly can be brittle and complex. It demonstrates how to write integration tests using a mock server to verify requests, responses, and error handling. The approach ensures reliable testing of request serialization, response deserialization, and behavior under errors.

Testing

Testing Serialization With Spring Boot @JsonTest

This article explains why testing JSON serialization and deserialization separately can improve reliability, especially for custom types or formats. It shows how to use lightweight test setups to verify that objects are correctly converted to and from JSON. Examples cover both serialization and deserialization with practical assertions for expected output and input.

Testing

Testing the Persistence Layer With Spring Boot @DataJpaTest

This article explains how to write reliable tests for the persistence layer. It covers creating database schemas, managing test data, and testing queries, constraints, and edge cases. Using the same database for tests and application ensures migrations and native queries behave as expected.

Testing