Upgrade to JUnit Jupiter 5.13.1
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run
Details
Build and Deploy Snapshot / Trigger Docs Build (push) Blocked by required conditions
Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:false version:17]) (push) Waiting to run
Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:true version:21]) (push) Waiting to run
Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run
Details
Build and Deploy Snapshot / Trigger Docs Build (push) Blocked by required conditions
Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:false version:17]) (push) Waiting to run
Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:true version:21]) (push) Waiting to run
Details
Closes gh-46058
This commit is contained in:
parent
fe049e6570
commit
ddf3984569
|
@ -13,7 +13,7 @@ graalVersion=22.3
|
|||
hamcrestVersion=3.0
|
||||
jacksonVersion=2.19.1
|
||||
javaFormatVersion=0.0.47
|
||||
junitJupiterVersion=5.12.2
|
||||
junitJupiterVersion=5.13.1
|
||||
kotlinVersion=2.1.0
|
||||
mavenVersion=3.9.10
|
||||
mockitoVersion=5.17.0
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.junit.jupiter.api.Named;
|
|||
import org.junit.jupiter.api.extension.ExtensionContext;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.ArgumentsProvider;
|
||||
import org.junit.jupiter.params.support.ParameterDeclarations;
|
||||
|
||||
import org.springframework.security.oauth2.jwt.Jwt;
|
||||
|
||||
|
@ -37,7 +38,8 @@ import org.springframework.security.oauth2.jwt.Jwt;
|
|||
public final class JwtConverterCustomizationsArgumentsProvider implements ArgumentsProvider {
|
||||
|
||||
@Override
|
||||
public Stream<? extends Arguments> provideArguments(ExtensionContext extensionContext) {
|
||||
public Stream<? extends Arguments> provideArguments(ParameterDeclarations parameterDeclarations,
|
||||
ExtensionContext extensionContext) {
|
||||
String customPrefix = "CUSTOM_AUTHORITY_PREFIX_";
|
||||
String customDelimiter = "[~,#:]";
|
||||
String customAuthoritiesClaim = "custom_authorities";
|
||||
|
|
|
@ -69,7 +69,7 @@ class ResourcesExtension implements BeforeEachCallback, AfterEachCallback, Param
|
|||
.addPackage(testMethod.getDeclaringClass().getPackage(), withPackageResources.value()));
|
||||
ResourcesClassLoader classLoader = new ResourcesClassLoader(context.getRequiredTestClass().getClassLoader(),
|
||||
resources);
|
||||
store.put(TCCL_KEY, Thread.currentThread().getContextClassLoader());
|
||||
store.put(TCCL_KEY, new Tccl());
|
||||
Thread.currentThread().setContextClassLoader(classLoader);
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ class ResourcesExtension implements BeforeEachCallback, AfterEachCallback, Param
|
|||
public void afterEach(ExtensionContext context) throws Exception {
|
||||
Store store = context.getStore(Namespace.create(ResourcesExtension.class));
|
||||
store.get(RESOURCES_KEY, Resources.class).delete();
|
||||
Thread.currentThread().setContextClassLoader(store.get(TCCL_KEY, ClassLoader.class));
|
||||
Thread.currentThread().setContextClassLoader(store.get(TCCL_KEY, Tccl.class).get());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -183,4 +183,23 @@ class ResourcesExtension implements BeforeEachCallback, AfterEachCallback, Param
|
|||
return resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Holder for the thread context class loader that can be safely
|
||||
* {@link Store#put(Object, Object) stored} without it causing unwanted
|
||||
* {@link ClassLoader#close closure} of the class loader.
|
||||
*/
|
||||
private static class Tccl {
|
||||
|
||||
private final ClassLoader classLoader;
|
||||
|
||||
Tccl() {
|
||||
this.classLoader = Thread.currentThread().getContextClassLoader();
|
||||
}
|
||||
|
||||
ClassLoader get() {
|
||||
return this.classLoader;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.stream.Stream;
|
|||
import org.junit.jupiter.api.extension.ExtensionContext;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.ArgumentsProvider;
|
||||
import org.junit.jupiter.params.support.ParameterDeclarations;
|
||||
import org.junit.platform.commons.util.Preconditions;
|
||||
|
||||
/**
|
||||
|
@ -32,7 +33,8 @@ import org.junit.platform.commons.util.Preconditions;
|
|||
class BooleanArgumentsProvider implements ArgumentsProvider {
|
||||
|
||||
@Override
|
||||
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
|
||||
public Stream<? extends Arguments> provideArguments(ParameterDeclarations parameterDeclarations,
|
||||
ExtensionContext context) {
|
||||
Method testMethod = context.getRequiredTestMethod();
|
||||
Preconditions.condition(testMethod.getParameterCount() > 0, () -> String.format(
|
||||
"@BooleanValueSource cannot provide arguments to method [%s]: the method does not declare any formal parameters.",
|
||||
|
|
Loading…
Reference in New Issue