Category: Unit Tests

Introduction to Spock Framework

What is Spock Framework anyway? Spock Framework is an open source testing and specification framework for Java and Groovy applications. It lets you write concise, expressive tests, Behaviour Driven Development (BDD) like form, what makes your test more clear. Spock is compatible with most IDEs, build tools, and continuous integration servers. Spock is inspired from JUnit, […]

Mocking the current date-time (properly) with Java

It’s not unusual to face situations where we need to capture the current system’s date-time in order to calculate some future date, make validations and so on. The problem generally appears as soon as we need to check whether some calculated date was correctly generated or not. When we directly use the instruction “new Date()” […]