Different Ways to Register Extensions

Understand different ways to register extensions in JUnit Jupiter.

Extensions can be registered in the following three ways.

  • Declarative Registration: With the @ExtendWith annotation.
  • Programmatic Registration: With the @RegisterExtension annotation.
  • Automatic Registration: With the service loader mechanism.

Get hands-on with 1200+ tech skills courses.