O'Reilly logo

Mastering Software Testing with JUnit 5 by Boni García

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

Introduction to Spring Test

Spring a module called spring-test, which supports unit and integration testing of Spring components. Among other features, this module provides the ability to create Spring application context for testing purposes or create mock objects that to test our code in isolation. There are different annotations supporting this testing capabilities. A list of the most significant one is the following:

  • @ContextConfiguration: This annotation is used to determine how to load and configure an ApplicationContext for integration tests. For example, it allows to load the application context from annotated classes (using the element classes) or bean definitions declared in XML files (using the element locations).
  • @ActiveProfiles ...

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