Browse Source

Avoid overriding methods deprecated in JUnit Jupiter 5.13

See gh-34969
pull/35405/head
Sam Brannen 8 months ago
parent
commit
016294b067
  1. 5
      spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanInstanceSupplierTests.java
  2. 7
      spring-context/src/test/java/org/springframework/format/datetime/standard/InstantFormatterTests.java

5
spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanInstanceSupplierTests.java

@ -1,5 +1,5 @@ @@ -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; @@ -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 { @@ -691,7 +692,7 @@ class BeanInstanceSupplierTests {
}
@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
public Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context) {
return this.source.provideArguments(context);
}
}

7
spring-context/src/test/java/org/springframework/format/datetime/standard/InstantFormatterTests.java

@ -1,5 +1,5 @@ @@ -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; @@ -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 { @@ -91,7 +92,7 @@ class InstantFormatterTests {
private static final Random random = new Random();
@Override
public final Stream<Arguments> provideArguments(ExtensionContext context) {
public final Stream<Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context) {
return provideArguments().map(Arguments::of).limit(DATA_SET_SIZE);
}
@ -137,7 +138,7 @@ class InstantFormatterTests { @@ -137,7 +138,7 @@ class InstantFormatterTests {
private static final Random random = new Random();
@Override
public Stream<Arguments> provideArguments(ExtensionContext context) {
public Stream<Arguments> 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))

Loading…
Cancel
Save