Skip to content

Commit b601944

Browse files
committed
Upgrade to JUnit Jupiter 5.12.1
Closes gh-44780
1 parent 3d650e4 commit b601944

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ graalVersion=22.3
1313
hamcrestVersion=3.0
1414
jacksonVersion=2.18.3
1515
javaFormatVersion=0.0.43
16-
junitJupiterVersion=5.11.4
16+
junitJupiterVersion=5.12.1
1717
kotlinVersion=1.9.25
1818
mavenVersion=3.9.4
1919
mockitoVersion=5.16.0

spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/resources/ResourcesExtension.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.junit.jupiter.api.extension.ParameterResolutionException;
3939
import org.junit.jupiter.api.extension.ParameterResolver;
4040
import org.junit.platform.commons.support.AnnotationSupport;
41-
import org.junit.platform.commons.support.SearchOption;
4241

4342
import org.springframework.util.StreamUtils;
4443

@@ -66,7 +65,7 @@ public void beforeEach(ExtensionContext context) throws Exception {
6665
resourcesOf(testMethod)
6766
.forEach((resource) -> resources.addResource(resource.name(), resource.content(), resource.additional()));
6867
resourceDirectoriesOf(testMethod).forEach((directory) -> resources.addDirectory(directory.value()));
69-
packageResourcesOf(testMethod).forEach((withPackageResources) -> resources
68+
packageResourcesOf(testMethod, context).forEach((withPackageResources) -> resources
7069
.addPackage(testMethod.getDeclaringClass().getPackage(), withPackageResources.value()));
7170
ResourcesClassLoader classLoader = new ResourcesClassLoader(context.getRequiredTestClass().getClassLoader(),
7271
resources);
@@ -93,12 +92,11 @@ private <A extends Annotation> List<A> withAnnotationsOf(Method method, Class<A>
9392
return annotations;
9493
}
9594

96-
private List<WithPackageResources> packageResourcesOf(Method method) {
95+
private List<WithPackageResources> packageResourcesOf(Method method, ExtensionContext context) {
9796
List<WithPackageResources> annotations = new ArrayList<>();
9897
AnnotationSupport.findAnnotation(method, WithPackageResources.class).ifPresent(annotations::add);
9998
AnnotationSupport
100-
.findAnnotation(method.getDeclaringClass(), WithPackageResources.class,
101-
SearchOption.INCLUDE_ENCLOSING_CLASSES)
99+
.findAnnotation(method.getDeclaringClass(), WithPackageResources.class, context.getEnclosingTestClasses())
102100
.ifPresent(annotations::add);
103101
return annotations;
104102
}

spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ dependencies {
3636
testImplementation("org.assertj:assertj-core")
3737
testImplementation("org.junit.jupiter:junit-jupiter")
3838
testImplementation("org.springframework:spring-core")
39+
40+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
3941
}
4042

4143
task syncTestRepository(type: Sync) {

0 commit comments

Comments
 (0)