With this post I start a new series in this blog: At every beginning of a new year I wanna do a retroperspective (motivated by Agile…) of the technical stuff in my life that happens during the last year. Mostly about the stuff I learned. So, here it goes and I hope it does not annoy you too much.
When you start using the Play Framework 2 you will notice that there are a bunch of test helpers and entry points to set up your tests. That’s great! One might thinks that’s too good to be true. And in fact, when using the
FakeApplication test helper you can run into subtle problems which cause unreliable tests.
When developing with elasticsearch one of the first problems is how to get tests in place that use a fast server instance. It should be easily embeddable in your tests and reliable.
I think one of the main disadvantages of Play’s design is the overuse of static methods in controllers. This causes hard to test controllers, long-running tests and decreases modularisation. So, how can we use Spring to rescue us?
In of my projects I am building a rest api with the playframework 2 (using the java api) and MongoDB as the persistence storage. One of the first question that arises was: how can I implement integration tests properly with a test instance of MongoDB? I wanted to have a known state in MongoDB for each test and it should be easy to set up the test instance.