This talk demonstrates how to use Docker in conjunction with Spock (using the Testcontainers library) by providing live demos and best practices for joyful integration testing. You will see how to spin-up and tear-down databases (relational and NoSQL), web-servers and even external applications on a test-class and test-method basis. In the end we’ll even have an outlook on functional testing using GEB and docker-compose with Spock.
Target Audience: Developers, Testers, DevOps
Prerequisites: Attendees should have basic knowledge about Java and Docker. Spring-Boot knowledge helps as well
Level: Practicing
Extended Abstract
The rise of container technologies allows us to fundamentally change the way we develop, test and deploy software. However, the problem and solution space with which software developers are confronted nowadays has become even bigger and we as a profession still need to discover patterns and practices for successfully dealing with this level of complexity.
Thanks to tools like Docker, spinning up a full-fledged relational database isn’t more difficult or time consuming than using an in-memory database anymore. So why not run your integration tests on your local machine, inside an environment which resembles production as close as possible?
This talk demonstrates how to use Docker in conjunction with Spock by providing live demos and best practices for joyful integration testing. You will see how to spin-up and tear-down databases (relational and NoSQL), web-servers and even external applications on a test-class and test-method basis. In the end, we’ll even have an outlook on functional testing using GEB and docker-compose with Spock. The practices and tools presented work the way in any environment, e.g. local dev machine or dockerized CI server.