Category Archives: Testing

CXF – Validating JAX-RS WADL files in unit tests

What’s the best way to stop developers breaking the WADLs generated by CXF for Java-first JAX-RS services? Make breaking the WADLs break the build of course. Continue reading

Spock – Starting your trek

Ready to add a little diversity to your Java testing? The Spock framework could be a good place to start. Continue reading

Spock – Sharing conditions across then blocks

Using helper methods with the Spock specification framework helps avoid duplicating conditions across multiple tests Continue reading

JUnit – Skipping tests with unavailable resources

If your unit tests depend on external resources they’re going to fail from time-to-time when those resources aren’t available. Here we look at a few options for preventing your build from breaking. Continue reading

Java – Simple Server Stubbing

When a Java Class Under Test makes HTTP calls that are tricky to mock, the Simple framework offers a neat alternative for a self-contained stub. Continue reading

Java – Getting cucumber results into Sonar

Sonar doesn’t seem to like second helpings of cucumber-java test results. Here’s a simple workaround to refresh its appetite. Continue reading

Groovy – Customising Power Assert messages

Power Assert messages are really useful when you’re trying to track down a problem using Groovy test cases. But what if you need just a little more information? Continue reading