Journal

Testing Java RMI with an Embedded RMI Registry
Java Remote Method Invocation (RMI) lets a client invoke a method on an object living in another JVM, even when that object is part of the same application. A…
Mocking HttpURLConnection in Java Legacy Tests
Legacy Java code often creates its HTTP client inline, casting URL.openConnection() to HttpURLConnection and sending requests directly from business logic.…
Testing Java schedulers and timers with Awaitility and CountDownLatch
Schedulers create a gap between starting a test and observing the work it triggers. A job may sit in a queue, run on another thread, or finish before its…
Writing tests for Java servlets with Spring mock objects
Writing tests for Java servlets with MockHttpServletRequest and MockHttpServletResponse brings the HTTP contract into a fast, deterministic unit test. The…
JUnit 5 parameterized tests for better data-driven testing
JUnit 5 parameterized tests let one test method exercise many inputs without copying the same scenario into separate methods. Instead of hard-coding a…
How to test file upload and download in Spring MVC with MockMvc
MockMvc gives Spring MVC tests a fast, deterministic way to exercise controllers without starting a live servlet container. It still runs the dispatcher,…
Testing Java annotation processing with compile-time tests
Java annotation processors run inside javac, before the JVM starts. They inspect Element and TypeElement instances, react to supported annotations, and may ask…
Performance testing Java socket connections with custom benchmarks
Socket latency can look healthy in a profiler and still disappoint users. A connection that opens in five milliseconds on loopback may take hundreds under…
How to use AssertJ for fluent assertions in Java tests
Readable assertions are part of a healthy Java test suite. They show which behaviour matters, make failures quick to interpret, and survive refactoring better…
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…