From 016294b067c64b588258fa90ec356d9aceb75ed4 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Fri, 30 May 2025 14:54:57 +0200 Subject: [PATCH] Avoid overriding methods deprecated in JUnit Jupiter 5.13 See gh-34969 --- .../beans/factory/aot/BeanInstanceSupplierTests.java | 5 +++-- .../format/datetime/standard/InstantFormatterTests.java | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanInstanceSupplierTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanInstanceSupplierTests.java index 3b33ea70b14..392444a1469 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanInstanceSupplierTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanInstanceSupplierTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; import org.junit.jupiter.params.support.AnnotationConsumer; +import org.junit.jupiter.params.support.ParameterDeclarations; import org.springframework.beans.factory.BeanCurrentlyInCreationException; import org.springframework.beans.factory.ObjectProvider; @@ -691,7 +692,7 @@ class BeanInstanceSupplierTests { } @Override - public Stream provideArguments(ExtensionContext context) { + public Stream provideArguments(ParameterDeclarations parameters, ExtensionContext context) { return this.source.provideArguments(context); } } diff --git a/spring-context/src/test/java/org/springframework/format/datetime/standard/InstantFormatterTests.java b/spring-context/src/test/java/org/springframework/format/datetime/standard/InstantFormatterTests.java index c57bc66bac5..bb6d42b4874 100644 --- a/spring-context/src/test/java/org/springframework/format/datetime/standard/InstantFormatterTests.java +++ b/spring-context/src/test/java/org/springframework/format/datetime/standard/InstantFormatterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; +import org.junit.jupiter.params.support.ParameterDeclarations; import static java.time.Instant.MAX; import static java.time.Instant.MIN; @@ -91,7 +92,7 @@ class InstantFormatterTests { private static final Random random = new Random(); @Override - public final Stream provideArguments(ExtensionContext context) { + public final Stream provideArguments(ParameterDeclarations parameters, ExtensionContext context) { return provideArguments().map(Arguments::of).limit(DATA_SET_SIZE); } @@ -137,7 +138,7 @@ class InstantFormatterTests { private static final Random random = new Random(); @Override - public Stream provideArguments(ExtensionContext context) { + public Stream provideArguments(ParameterDeclarations parameters, ExtensionContext context) { return random.longs(DATA_SET_SIZE, Long.MIN_VALUE, Long.MAX_VALUE) .mapToObj(Instant::ofEpochMilli) .map(instant -> instant.truncatedTo(ChronoUnit.MILLIS))