File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,21 @@ It consists of just an Hibernate SQL inspector service and a Spring Test Listene
2424## How to integrate
2525- Register the SQL inspector service in the registry, you just need to add this key in your configuration (here for yml):
2626
27-
28- spring:
29- jpa:
30- properties:
31- hibernate.session_factory.statement_inspector: com.lemick.integration.hibernate.HibernateStatementCountInspector
27+ spring:
28+ jpa:
29+ properties:
30+ hibernate.session_factory.statement_inspector: com.lemick.integration.hibernate.HibernateStatementCountInspector
3231
3332- Register the Spring TestListener that will launch the SQL inspection is the annotation is present
33+ By adding the listener on each of your integration test:
34+
35+ @SpringBootTest(webEnvironment = RANDOM_PORT)
36+ @TestExecutionListeners(listeners = HibernateStatementCountTestListener.class, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS)
37+ class TestDatasourceProxyApplicationTests {
38+ ...
39+ }
40+
41+ Or globally by adding a META-INF/spring.factories file that contains the listener:
42+
43+ org.springframework.test.context.TestExecutionListener=com.lemick.integration.spring.HibernateStatementCountTestListener
44+
You can’t perform that action at this time.
0 commit comments