Closed
Description
Dave Syer opened SPR-16369 and commented
spring-test has this in META-INF/spring.factories:
org.springframework.test.context.TestExecutionListener = \
org.springframework.test.context.web.ServletTestExecutionListener,\
org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener,\
org.springframework.test.context.support.DependencyInjectionTestExecutionListener,\
org.springframework.test.context.support.DirtiesContextTestExecutionListener,\
org.springframework.test.context.transaction.TransactionalTestExecutionListener,\
org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
and then it logs at INFO level (in AbstractTestContextBootstrapper.instantiateListeners()
) any of those that it cannot load. This is kind of ugly because it generates a lot of logging (several lines per test in a phase that is too early to change using Spring Boot configuration). Maybe they could be logged at a lower level?
Example logs:
2018-01-12 08:49:51.439 INFO 29447 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Could not instantiate TestExecutionListener [org.springframework.test.context.transaction.TransactionalTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [org/springframework/transaction/interceptor/TransactionAttributeSource]
2018-01-12 08:49:51.439 INFO 29447 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Could not instantiate TestExecutionListener [org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [org/springframework/transaction/interceptor/TransactionAttribute]
2018-01-12 08:49:51.439 INFO 29447 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [javax/servlet/ServletContext]
2018-01-12 08:49:51.439 INFO 29447 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@5b275174, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@10ef5fa0, org.springframework.test.context.support.DirtiesContextTestExecutionListener@244e619a, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@10acd6, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@61dde151, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@b25b095, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@5cb042da, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@59c33386, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@571a9686]
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
Referenced from: commits ea5f8f5, a15975d, 19640ec, 2145766
Backported to: 4.3.14