O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using fixtures to populate data for testing

In more complex applications (which use a database, for example), there is often a need to set up the same data before each test and clean it up after each test is run. Some parts of the data need to be set before each test method and cleaned afterwards. You'd also need to have another setup configured before you run the test class, and it should be cleaned up afterwards.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required