Showing posts from December, 2013

Parametrized JUnit tests with JUnitParams

Parameterized unit tests are used to to test the same code under different conditions. Thanks to parameterized unit tests we can set up a test method that retrieves data from some data source. This data source can be a collection of test data objects, external file or maybe even a database. The general idea is to make it easy to test different conditions with the same unit test method, which will limit the source code we need to write and makes the test code more robust. We can call these tests data-driven unit tests. The best way to achieve data-driven unit tests in JUnit is to use a JUnit's custom runner - Parameterized or JUnitParams' JUnitParamsRunner . Using JUnit's approach may work in many cases, but the latter seems to be more easy to use and more powerfull.

Fixing someone else's code

Collective code ownership is very important part of any successful Agile project where everyone in the team shares responsibility for the quality of code. Any developer can change the code, fix the bug he notices and refactor as the code belongs to the team.

HOW-TO: Get started quickly with Spring 4.0 to build a simple REST-Like API (walkthrough)

Yet another tutorial about creating Web API with Spring MVC. Not really sophisticated. Just a walkthrough. The resulting app will serve simple API, will use Mongo as its persistence and it will be secured with Spring Security.