Java, Web and Mobile

Blog

Howto: REST Assured

|
Java|Testing

In my current project I work in the QA-team. One of the questions we have to answer was, “How can we test a rest webservice?” With REST Assured, we found an easy way to test the service from various aspects. This tutorial explains how.

Agreements under Test – Part II

|
Java|Testing

The first part of this post introduced parameterized tests to avoid missing or unnecessary translation resources. I also showed an example of a possibly parameterized test, which was to outline how good test failure design helps to find all errors instead only the first or have static variables.

Agreements under Test – Part I

|
Java|Testing

Being part of a software development team, bound to an organization leads to a variety of agreements. As a Java developer I often adhere to the mature rules from Effective Java (Joshua Bloch) or from the Design Patterns Book of the Gang of Four (Erich Gamma et al). To bring that idea to future developers I often use Unit tests to express the common sense behind these rules as code. And I don’t overdo it but use parameterized tests excessively. So my code does not only contain the technical solution to a functional requirement and the necessary unit tests. In addition I provide unit tests for the non functional requirements. As an introduction I chose internationalization (i18n) requirements to be unit tested.

Testing your rules without pain

|
Java|Testing

In my current project we decided to use JBoss Drools 6, mainly for mapping data. It turned out to come in quite handy. However, when I tried to unit test my rules I was astonished how clumsy and cumbersome that was. Therefore I wrote a little library containing a JUnit-Runner that hides the needed boiler plate code and just lets you focus on the important thing: testing the rules.

How to unit test hazelcast

|
Java|Testing

Recently I used hazelcast in several projects. Especially in an Application Server environment using the hazelcast JCA connector it is pretty easy to use hazelcast with only a few lines of code. Unfortunately, Hazelcast.getAllHazelcastInstances() returns an empty set in unit tests. So, what we need to do is to mock our HazelcastFactory somehow.