From 1d48f31e4b066f1345a5371852873632d2ccf07b Mon Sep 17 00:00:00 2001 From: Christian Frommeyer Date: Wed, 16 Jun 2021 11:47:48 +0200 Subject: [PATCH] Replace StringUtils from oauth2-oidc-sdk SecurityMockServerConfigurers.java previously used the StringUtils from the optional oauth2-oidc-sdk dependency. Replacing this with the StringUtils from the spring framework this should not force adding the dependency in cases where it is not actually used. Closes gh-9923 --- .../web/reactive/server/SecurityMockServerConfigurers.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/src/main/java/org/springframework/security/test/web/reactive/server/SecurityMockServerConfigurers.java b/test/src/main/java/org/springframework/security/test/web/reactive/server/SecurityMockServerConfigurers.java index 6b21de46cc..e489335c6f 100644 --- a/test/src/main/java/org/springframework/security/test/web/reactive/server/SecurityMockServerConfigurers.java +++ b/test/src/main/java/org/springframework/security/test/web/reactive/server/SecurityMockServerConfigurers.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -29,7 +29,6 @@ import java.util.function.Consumer; import java.util.function.Supplier; import java.util.stream.Collectors; -import com.nimbusds.oauth2.sdk.util.StringUtils; import reactor.core.publisher.Mono; import org.springframework.context.ApplicationContext; @@ -82,6 +81,7 @@ import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClientConfigurer; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; +import org.springframework.util.StringUtils; import org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver; import org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer; import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerAdapter; @@ -663,7 +663,7 @@ public final class SecurityMockServerConfigurers { return getAuthorities((Collection) scope); } String scopes = scope.toString(); - if (StringUtils.isBlank(scopes)) { + if (!StringUtils.hasText(scopes)) { return Collections.emptyList(); } return getAuthorities(Arrays.asList(scopes.split(" ")));