Skip to content

Commit 3862eeb

Browse files
committed
chore: use spring-test-context-cache-limiter to control a number of test context
This should prevent the cases when tests use different contexts like we had in #1589
1 parent 7a52ffe commit 3862eeb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: pom.xml

+16
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,13 @@
399399
</exclusions>
400400
</dependency>
401401

402+
<dependency>
403+
<groupId>com.teketik</groupId>
404+
<artifactId>spring-test-context-cache-limiter</artifactId>
405+
<version>${spring-test-context-cache-limiter.version}</version>
406+
<scope>test</scope>
407+
</dependency>
408+
402409
<dependency>
403410
<groupId>io.qala.datagen</groupId>
404411
<artifactId>qala-datagen</artifactId>
@@ -683,6 +690,8 @@
683690
<!-- LATER: remove overriding once version from Spring Boot will match the used one -->
684691
<spring-framework.version>5.1.20.RELEASE</spring-framework.version>
685692

693+
<spring-test-context-cache-limiter.version>boot2-v1.2</spring-test-context-cache-limiter.version>
694+
686695
<!--
687696
Define default value for spring-boot-starter-parent:
688697
https://github.com/spring-projects/spring-boot/blob/v2.1.18.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/pom.xml
@@ -1009,6 +1018,13 @@
10091018
<configuration>
10101019
<skipTests>${skipUnitTests}</skipTests>
10111020
<disableXmlReport>${disableXmlReport}</disableXmlReport>
1021+
<systemPropertyVariables>
1022+
<!--
1023+
Specify the maximum number of contexts that should be created during unit tests
1024+
See for details: https://github.com/antoinemeyer/spring-test-context-cache-limiter
1025+
-->
1026+
<spring.test.context.limitSize>1</spring.test.context.limitSize>
1027+
</systemPropertyVariables>
10121028
</configuration>
10131029
</plugin>
10141030

0 commit comments

Comments
 (0)