Journal

Testing Java microservices with Testcontainers and LocalStack
Java microservices often meet AWS through queues, object storage, event streams and managed databases. Those boundaries are where release confidence is hardest…
Writing Integration Tests for gRPC Services in Java
Writing integration tests for gRPC services requires more than checking whether a Java method returns the expected value. A useful test should exercise the…
Static method mocking with Mockito Inline and PowerMock
Static calls sit awkwardly in unit tests because they bypass the object graph that ordinary mocks control. A service may invoke a utility for a token, a legacy…
Generating realistic Java test data with Instancio
Creating test data by hand becomes tedious as soon as a Java application contains more than a few related objects. Testers and developers end up maintaining…
Testing reactive streams with Reactor Test in Spring WebFlux
Reactive endpoints in Spring WebFlux can still be changing when a test receives a result. A response may arrive later, an error may replace the expected body,…
Enforcing Java Architecture Rules with ArchUnit
A Java codebase can look modular in a repository diagram and still be tightly coupled in practice. A controller may import a repository, a domain package may…
Testing Java Records and Sealed Classes with JUnit 5
Java records and sealed classes bring stronger modelling tools to backend applications. Records make immutable data carriers concise, while sealed hierarchies…
Custom Hamcrest Matchers for Cleaner Java Assertions
Java tests become harder to maintain when assertions describe how values are stored rather than what the behaviour should mean. Comparing three separate fields…
How to test continuous delivery pipelines with Jenkins Pipeline Unit
Continuous delivery turns a Jenkins pipeline into a frequently executed production system. A small error in branch detection, artefact naming, or deployment…
Testing Java message-driven beans in an embedded EJB container
Message-driven beans turn asynchronous JMS events into application work, but the risky behaviour sits between several components: a broker accepts a message,…