Merge branch '6.0.x'
This commit is contained in:
commit
b8a713fde3
|
@ -287,7 +287,7 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
|
|||
RootBeanDefinition beanDefinition = registeredBean.getMergedBeanDefinition();
|
||||
InjectionMetadata metadata = findInjectionMetadata(beanName, beanClass, beanDefinition);
|
||||
Collection<AutowiredElement> autowiredElements = getAutowiredElements(metadata,
|
||||
registeredBean.getMergedBeanDefinition().getPropertyValues());
|
||||
beanDefinition.getPropertyValues());
|
||||
if (!ObjectUtils.isEmpty(autowiredElements)) {
|
||||
return new AotContribution(beanClass, autowiredElements, getAutowireCandidateResolver());
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public abstract class CoroutinesUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Invoke a suspending function and converts it to {@link Mono} or {@link Flux}.
|
||||
* Invoke a suspending function and convert it to {@link Mono} or {@link Flux}.
|
||||
* Uses an {@linkplain Dispatchers#getUnconfined() unconfined} dispatcher.
|
||||
* @param method the suspending function to invoke
|
||||
* @param target the target to invoke {@code method} on
|
||||
|
@ -85,7 +85,7 @@ public abstract class CoroutinesUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Invoke a suspending function and converts it to {@link Mono} or
|
||||
* Invoke a suspending function and convert it to {@link Mono} or
|
||||
* {@link Flux}.
|
||||
* @param context the coroutine context to use
|
||||
* @param method the suspending function to invoke
|
||||
|
|
|
@ -349,9 +349,9 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
|
|||
|
||||
@Nullable
|
||||
private Method findGetterForProperty(String propertyName, Class<?> clazz, Object target) {
|
||||
boolean targetIsaClass = (target instanceof Class);
|
||||
Method method = findGetterForProperty(propertyName, clazz, targetIsaClass);
|
||||
if (method == null && targetIsaClass) {
|
||||
boolean targetIsAClass = (target instanceof Class);
|
||||
Method method = findGetterForProperty(propertyName, clazz, targetIsAClass);
|
||||
if (method == null && targetIsAClass) {
|
||||
// Fallback for getter instance methods in java.lang.Class.
|
||||
method = findGetterForProperty(propertyName, Class.class, false);
|
||||
}
|
||||
|
|
|
@ -544,7 +544,7 @@ class EvaluationTests extends AbstractExpressionTests {
|
|||
|
||||
pattern += "?";
|
||||
assertThat(pattern).hasSize(1001);
|
||||
evaluateAndCheckError("'abc' matches '" + pattern + "'", Boolean.class, SpelMessage.MAX_REGEX_LENGTH_EXCEEDED);
|
||||
evaluateAndCheckError("'X' matches '" + pattern + "'", Boolean.class, SpelMessage.MAX_REGEX_LENGTH_EXCEEDED);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ class KotlinSpelReproTests {
|
|||
val expr = parser.parseExpression("#key.startsWith('hello')")
|
||||
context.registerFunction("suspendingGet", Config::class.java.getMethod("suspendingGet", String::class.java, Continuation::class.java))
|
||||
context.setVariable("key", "hello world")
|
||||
assertThat(expr .getValue(context, Boolean::class.java)).isTrue()
|
||||
assertThat(expr.getValue(context, Boolean::class.java)).isTrue()
|
||||
context.setVariable("key", "")
|
||||
assertThat(expr.getValue(context, Boolean::class.java)).isFalse()
|
||||
}
|
||||
|
|
|
@ -410,7 +410,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
|||
}
|
||||
// Create new (method local) connection, which is later assigned to instance connection
|
||||
// - prevention to hold instance connection without exception listener, in case when
|
||||
// some subsequent methods (after creation of connection) throws JMSException
|
||||
// some subsequent methods (after creation of connection) throw JMSException
|
||||
Connection con = doCreateConnection();
|
||||
try {
|
||||
prepareConnection(con);
|
||||
|
@ -422,9 +422,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
|||
con.close();
|
||||
}
|
||||
catch(Throwable th) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Could not close newly obtained JMS Connection that failed to prepare", th);
|
||||
}
|
||||
logger.debug("Could not close newly obtained JMS Connection that failed to prepare", th);
|
||||
}
|
||||
throw ex;
|
||||
}
|
||||
|
|
|
@ -360,7 +360,7 @@ public class PersistenceAnnotationBeanPostProcessor implements InstantiationAwar
|
|||
RootBeanDefinition beanDefinition = registeredBean.getMergedBeanDefinition();
|
||||
InjectionMetadata metadata = findInjectionMetadata(beanDefinition, beanClass, beanName);
|
||||
Collection<InjectedElement> injectedElements = metadata.getInjectedElements(
|
||||
registeredBean.getMergedBeanDefinition().getPropertyValues());
|
||||
beanDefinition.getPropertyValues());
|
||||
if (!CollectionUtils.isEmpty(injectedElements)) {
|
||||
return new AotContribution(beanClass, injectedElements);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class CookieAssertionTests {
|
|||
|
||||
private static final String COOKIE_NAME = CookieLocaleResolver.DEFAULT_COOKIE_NAME;
|
||||
private static final String COOKIE_WITH_ATTRIBUTES_NAME = "SecondCookie";
|
||||
protected static final String SECOND_COOKIE_ATTRIBUTE = "COOKIE_ATTRIBUTE";
|
||||
private static final String SECOND_COOKIE_ATTRIBUTE = "COOKIE_ATTRIBUTE";
|
||||
|
||||
private MockMvc mockMvc;
|
||||
|
||||
|
|
|
@ -445,7 +445,7 @@ public abstract class AbstractReactiveTransactionManager implements ReactiveTran
|
|||
return doCommit(synchronizationManager, status);
|
||||
}
|
||||
return Mono.empty();
|
||||
})) //
|
||||
}))
|
||||
.onErrorResume(ex -> {
|
||||
Mono<Void> propagateException = Mono.error(ex);
|
||||
// Store result in a local variable in order to appease the
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.junit.jupiter.api.Test
|
|||
import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.http.HttpStatus
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.lang.Nullable
|
||||
import org.springframework.web.service.annotation.GetExchange
|
||||
|
||||
/**
|
||||
|
@ -65,7 +64,7 @@ class KotlinHttpServiceMethodTests {
|
|||
verifyClientInvocation("requestToEntityFlux", object : ParameterizedTypeReference<String>() {})
|
||||
}
|
||||
|
||||
private fun verifyClientInvocation(methodName: String, @Nullable expectedBodyType: ParameterizedTypeReference<*>) {
|
||||
private fun verifyClientInvocation(methodName: String, expectedBodyType: ParameterizedTypeReference<*>) {
|
||||
assertThat(client.invokedMethodName).isEqualTo(methodName)
|
||||
assertThat(client.bodyType).isEqualTo(expectedBodyType)
|
||||
}
|
||||
|
|
|
@ -738,7 +738,7 @@ class DefaultWebClient implements WebClient {
|
|||
|
||||
private final ClientRequestObservationContext observationContext;
|
||||
|
||||
public ObservationFilterFunction(ClientRequestObservationContext observationContext) {
|
||||
ObservationFilterFunction(ClientRequestObservationContext observationContext) {
|
||||
this.observationContext = observationContext;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,14 +121,14 @@ class DefaultServerResponseBuilder implements ServerResponse.BodyBuilder {
|
|||
|
||||
@Override
|
||||
public ServerResponse.BodyBuilder allow(HttpMethod... allowedMethods) {
|
||||
Assert.notNull(allowedMethods, "Http allowedMethod must not be null");
|
||||
Assert.notNull(allowedMethods, "Http allowedMethods must not be null");
|
||||
this.headers.setAllow(new LinkedHashSet<>(Arrays.asList(allowedMethods)));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse.BodyBuilder allow(Set<HttpMethod> allowedMethods) {
|
||||
Assert.notNull(allowedMethods, "Http allowedMethod must not be null");
|
||||
Assert.notNull(allowedMethods, "Http allowedMethods must not be null");
|
||||
this.headers.setAllow(allowedMethods);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
@ -60,12 +60,12 @@ public class ParameterContentTypeResolverTests {
|
|||
Map<String, MediaType> mapping = Collections.emptyMap();
|
||||
RequestedContentTypeResolver resolver = new ParameterContentTypeResolver(mapping);
|
||||
List<MediaType> mediaTypes = resolver.resolveMediaTypes(exchange);
|
||||
assertThat(mediaTypes).isEqualTo(Collections.singletonList(new MediaType("text", "html")));
|
||||
assertThat(mediaTypes).containsExactly(new MediaType("text", "html"));
|
||||
|
||||
mapping = Collections.singletonMap("HTML", MediaType.APPLICATION_XHTML_XML);
|
||||
resolver = new ParameterContentTypeResolver(mapping);
|
||||
mediaTypes = resolver.resolveMediaTypes(exchange);
|
||||
assertThat(mediaTypes).isEqualTo(Collections.singletonList(new MediaType("application", "xhtml+xml")));
|
||||
assertThat(mediaTypes).containsExactly(new MediaType("application", "xhtml+xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -74,7 +74,7 @@ public class ParameterContentTypeResolverTests {
|
|||
RequestedContentTypeResolver resolver = new ParameterContentTypeResolver(Collections.emptyMap());
|
||||
List<MediaType> mediaTypes = resolver.resolveMediaTypes(exchange);
|
||||
|
||||
assertThat(mediaTypes).isEqualTo(Collections.singletonList(new MediaType("application", "vnd.ms-excel")));
|
||||
assertThat(mediaTypes).containsExactly(new MediaType("application", "vnd.ms-excel"));
|
||||
}
|
||||
|
||||
@Test // SPR-13747
|
||||
|
@ -84,7 +84,7 @@ public class ParameterContentTypeResolverTests {
|
|||
ParameterContentTypeResolver resolver = new ParameterContentTypeResolver(mapping);
|
||||
List<MediaType> mediaTypes = resolver.resolveMediaTypes(exchange);
|
||||
|
||||
assertThat(mediaTypes).isEqualTo(Collections.singletonList(MediaType.APPLICATION_JSON));
|
||||
assertThat(mediaTypes).containsExactly(MediaType.APPLICATION_JSON);
|
||||
}
|
||||
|
||||
private MockServerWebExchange createExchange(String format) {
|
||||
|
|
|
@ -40,7 +40,7 @@ public class RequestedContentTypeResolverBuilderTests {
|
|||
MockServerHttpRequest.get("/flower").accept(MediaType.IMAGE_GIF));
|
||||
List<MediaType> mediaTypes = resolver.resolveMediaTypes(exchange);
|
||||
|
||||
assertThat(mediaTypes).isEqualTo(Collections.singletonList(MediaType.IMAGE_GIF));
|
||||
assertThat(mediaTypes).containsExactly(MediaType.IMAGE_GIF);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -52,7 +52,7 @@ public class RequestedContentTypeResolverBuilderTests {
|
|||
MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/flower?format=json"));
|
||||
List<MediaType> mediaTypes = resolver.resolveMediaTypes(exchange);
|
||||
|
||||
assertThat(mediaTypes).isEqualTo(Collections.singletonList(MediaType.APPLICATION_JSON));
|
||||
assertThat(mediaTypes).containsExactly(MediaType.APPLICATION_JSON);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -87,11 +87,11 @@ public class RequestedContentTypeResolverBuilderTests {
|
|||
|
||||
MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/"));
|
||||
List<MediaType> mediaTypes = resolver.resolveMediaTypes(exchange);
|
||||
assertThat(mediaTypes).isEqualTo(Collections.singletonList(MediaType.APPLICATION_JSON));
|
||||
assertThat(mediaTypes).containsExactly(MediaType.APPLICATION_JSON);
|
||||
|
||||
exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/").accept(MediaType.ALL));
|
||||
mediaTypes = resolver.resolveMediaTypes(exchange);
|
||||
assertThat(mediaTypes).isEqualTo(Collections.singletonList(MediaType.APPLICATION_JSON));
|
||||
assertThat(mediaTypes).containsExactly(MediaType.APPLICATION_JSON);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -104,7 +104,7 @@ public class RequestedContentTypeResolverBuilderTests {
|
|||
MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/")
|
||||
.accept(MediaType.valueOf("*/*;q=0.8")));
|
||||
List<MediaType> mediaTypes = resolver.resolveMediaTypes(exchange);
|
||||
assertThat(mediaTypes).isEqualTo(Collections.singletonList(MediaType.APPLICATION_JSON));
|
||||
assertThat(mediaTypes).containsExactly(MediaType.APPLICATION_JSON);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue