Testing
-
Enterprise Java

Mocking Spring Security Context for Unit Testing
Today, while writing unit test case for one of the Java method which looks like below: public ApplicationUser getApplicationUser() { ApplicationUser…
Read More » -
Enterprise Java

Boosting test performance with TestContainers
In my previous post on testing, I described how to use TestContainers to provide realistic test environments for database tests.…
Read More » -
Software Development

Single Statement Unit Tests
Many articles and books have already been written about unit testing patterns and anti-patterns. I want to add one more…
Read More » -
Core Java

Importance of given-when-then in unit tests and TDD
Recently, I’ve been writing rather about more advanced concepts related to automatic testing (mostly related to Spock). However, conducting my…
Read More » -
Core Java

Automated Tests for Asynchronous Processes
It’s been a while since I’ve worked on a server-side application that had asynchronous behaviour that wasn’t already an event-driven…
Read More » -
Software Development

Every project is test driven in the end
Let me give you the punch-line and then explain myself: As soon as testing starts every “project” becomes a test…
Read More » -
Software Development

Never trust a passing test
One of the lessons when practising TDD is to never trust a passing test. If you haven’t seen the test…
Read More » -
Core Java

Expected Exception Rule and Mocking Static Methods – JUnit
Today I was asked to consume a RESTful service so I started implementing it following Robert Cecil Martin’s rules for…
Read More » -
Core Java

Unit testing Java data classes immutability with the Mutability Detector
In all our project, we use data classes which, by definition, contain data (fields) but no (business) logic. According to…
Read More »




