Skip to Content
Building RESTful Web Services with Java EE 8
book

Building RESTful Web Services with Java EE 8

by Mario-Leander Reimer
July 2018
Intermediate to advanced
116 pages
2h 41m
English
Packt Publishing
Content preview from Building RESTful Web Services with Java EE 8

Test Containers

Let's look at the next test framework, which is called Test Containers. We need to add the following two dependencies to activate the Test Containers framework:

        <dependency>            <groupId>org.testcontainers</groupId>            <artifactId>testcontainers</artifactId>            <version>1.5.1</version>            <scope>test</scope>        </dependency>        <dependency>            <groupId>org.slf4j</groupId>            <artifactId>slf4j-simple</artifactId>            <version>1.7.25</version>            <scope>test</scope>        </dependency>

The idea behind Test Containers is really simple. Since we're going to deploy our web service in a Docker container anyway, why not use a Docker container during our test as well? All you need to add is a @ClassRule. We create GenericContainer, we pass it to a Dockerfile, we pass ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

RESTful Java Web Services - Third Edition

RESTful Java Web Services - Third Edition

Balachandar Bogunuva Mohanram

Publisher Resources

ISBN: 9781789532883Supplemental Content