Issue
I updated the project from spring boot 2.6 to 2.7 and I'm having trouble registering the TestExecutionListener class. Before it was registered in spring.factories
org.springframework.test.context.TestExecutionListener = com.example.MyListener
Release notes says about move spring.factories into imports file If you have created your own test-slices, you should move the registration from spring.factories to the new place under META-INF/spring/.imports
Now, i have no idea how do it. I've tried many options and configrations and no one works well for me.
Solution
You should read the documentation again. The spring.factories
is deprecated for
- Auto-configuration classes
- Test Slices
but not for registering TestExecutionListener
instances for the tests.
Answered By - M. Deinum
Answer Checked By - Candace Johnson (JavaFixing Volunteer)