Template Driven Test POJO Generation with Fixture Factory and Java

In our tests we often need to create a bunch of test-objects that are populated with random-data. This data needs to follow specific rules as identifiers need to be unique or must be incremented, string-properties must follow special conventions and so on. In the following short tutorial I will demonstrate how to generate such test data using the Fixture Factory library. Figure 1. Fixture Factory and JUnit...

June 20, 2017 · 8 min · 1689 words · Micha Kops

Mocking HTTP Interaction with Java, JUnit and MockServer

When writing tests for our software components sometimes we need to mock external services based on the HTTP protocol, might it be a RESTful web-service, an XML-RPC call or a simple GET request to some web-server. In the following short tutorial I’d like to demonstrate how to create a mock HTTP server for testing and how to bootstrap and bind it to the life-cycle of a classical build-management tool like Maven. ...

January 5, 2016 · 4 min · 821 words · Micha Kops