Merge branch '5.1.x'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -40,8 +40,10 @@ import org.springframework.lang.Nullable;
|
||||
public interface DeferredImportSelector extends ImportSelector {
|
||||
|
||||
/**
|
||||
* Return a specific import group or {@code null} if no grouping is required.
|
||||
* @return the import group class or {@code null}
|
||||
* Return a specific import group.
|
||||
* <p>The default implementations return {@code null} for no grouping required.
|
||||
* @return the import group class, or {@code null} if none
|
||||
* @since 5.0
|
||||
*/
|
||||
@Nullable
|
||||
default Class<? extends Group> getImportGroup() {
|
||||
@@ -61,11 +63,12 @@ public interface DeferredImportSelector extends ImportSelector {
|
||||
void process(AnnotationMetadata metadata, DeferredImportSelector selector);
|
||||
|
||||
/**
|
||||
* Return the {@link Entry entries} of which class(es) should be imported for this
|
||||
* group.
|
||||
* Return the {@link Entry entries} of which class(es) should be imported
|
||||
* for this group.
|
||||
*/
|
||||
Iterable<Entry> selectImports();
|
||||
|
||||
|
||||
/**
|
||||
* An entry that holds the {@link AnnotationMetadata} of the importing
|
||||
* {@link Configuration} class and the class name to import.
|
||||
@@ -97,16 +100,16 @@ public interface DeferredImportSelector extends ImportSelector {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
if (other == null || getClass() != other.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Entry entry = (Entry) o;
|
||||
return Objects.equals(this.metadata, entry.metadata) &&
|
||||
Objects.equals(this.importClassName, entry.importClassName);
|
||||
Entry entry = (Entry) other;
|
||||
return (Objects.equals(this.metadata, entry.metadata) &&
|
||||
Objects.equals(this.importClassName, entry.importClassName));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -58,7 +58,6 @@ public interface ImportBeanDefinitionRegistrar {
|
||||
* @param importingClassMetadata annotation metadata of the importing class
|
||||
* @param registry current bean definition registry
|
||||
*/
|
||||
public void registerBeanDefinitions(
|
||||
AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry);
|
||||
void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry);
|
||||
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ import org.springframework.core.type.AnnotationMetadata;
|
||||
|
||||
/**
|
||||
* Interface to be implemented by types that determine which @{@link Configuration}
|
||||
* class(es) should be imported based on a given selection criteria, usually one or more
|
||||
* annotation attributes.
|
||||
* class(es) should be imported based on a given selection criteria, usually one or
|
||||
* more annotation attributes.
|
||||
*
|
||||
* <p>An {@link ImportSelector} may implement any of the following
|
||||
* {@link org.springframework.beans.factory.Aware Aware} interfaces, and their respective
|
||||
* methods will be called prior to {@link #selectImports}:
|
||||
* {@link org.springframework.beans.factory.Aware Aware} interfaces,
|
||||
* and their respective methods will be called prior to {@link #selectImports}:
|
||||
* <ul>
|
||||
* <li>{@link org.springframework.context.EnvironmentAware EnvironmentAware}</li>
|
||||
* <li>{@link org.springframework.beans.factory.BeanFactoryAware BeanFactoryAware}</li>
|
||||
@@ -33,10 +33,10 @@ import org.springframework.core.type.AnnotationMetadata;
|
||||
* <li>{@link org.springframework.context.ResourceLoaderAware ResourceLoaderAware}</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>ImportSelectors are usually processed in the same way as regular {@code @Import}
|
||||
* annotations, however, it is also possible to defer selection of imports until all
|
||||
* {@code @Configuration} classes have been processed (see {@link DeferredImportSelector}
|
||||
* for details).
|
||||
* <p>{@code ImportSelector} implementations are usually processed in the same way
|
||||
* as regular {@code @Import} annotations, however, it is also possible to defer
|
||||
* selection of imports until all {@code @Configuration} classes have been processed
|
||||
* (see {@link DeferredImportSelector} for details).
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -640,7 +640,7 @@ public abstract class ObjectUtils {
|
||||
|
||||
/**
|
||||
* Determine the class name for the given object.
|
||||
* <p>Returns {@code "null"} if {@code obj} is {@code null}.
|
||||
* <p>Returns a {@code "null"} String if {@code obj} is {@code null}.
|
||||
* @param obj the object to introspect (may be {@code null})
|
||||
* @return the corresponding class name
|
||||
*/
|
||||
@@ -651,7 +651,7 @@ public abstract class ObjectUtils {
|
||||
/**
|
||||
* Return a String representation of the specified Object.
|
||||
* <p>Builds a String representation of the contents in case of an array.
|
||||
* Returns {@code "null"} if {@code obj} is {@code null}.
|
||||
* Returns a {@code "null"} String if {@code obj} is {@code null}.
|
||||
* @param obj the object to build a String representation for
|
||||
* @return a String representation of {@code obj}
|
||||
*/
|
||||
@@ -697,8 +697,8 @@ public abstract class ObjectUtils {
|
||||
* Return a String representation of the contents of the specified array.
|
||||
* <p>The String representation consists of a list of the array's elements,
|
||||
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
|
||||
* by the characters {@code ", "} (a comma followed by a space). Returns
|
||||
* {@code "null"} if {@code array} is {@code null}.
|
||||
* by the characters {@code ", "} (a comma followed by a space).
|
||||
* Returns a {@code "null"} String if {@code array} is {@code null}.
|
||||
* @param array the array to build a String representation for
|
||||
* @return a String representation of {@code array}
|
||||
*/
|
||||
@@ -721,8 +721,8 @@ public abstract class ObjectUtils {
|
||||
* Return a String representation of the contents of the specified array.
|
||||
* <p>The String representation consists of a list of the array's elements,
|
||||
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
|
||||
* by the characters {@code ", "} (a comma followed by a space). Returns
|
||||
* {@code "null"} if {@code array} is {@code null}.
|
||||
* by the characters {@code ", "} (a comma followed by a space).
|
||||
* Returns a {@code "null"} String if {@code array} is {@code null}.
|
||||
* @param array the array to build a String representation for
|
||||
* @return a String representation of {@code array}
|
||||
*/
|
||||
@@ -753,8 +753,8 @@ public abstract class ObjectUtils {
|
||||
* Return a String representation of the contents of the specified array.
|
||||
* <p>The String representation consists of a list of the array's elements,
|
||||
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
|
||||
* by the characters {@code ", "} (a comma followed by a space). Returns
|
||||
* {@code "null"} if {@code array} is {@code null}.
|
||||
* by the characters {@code ", "} (a comma followed by a space).
|
||||
* Returns a {@code "null"} String if {@code array} is {@code null}.
|
||||
* @param array the array to build a String representation for
|
||||
* @return a String representation of {@code array}
|
||||
*/
|
||||
@@ -784,8 +784,8 @@ public abstract class ObjectUtils {
|
||||
* Return a String representation of the contents of the specified array.
|
||||
* <p>The String representation consists of a list of the array's elements,
|
||||
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
|
||||
* by the characters {@code ", "} (a comma followed by a space). Returns
|
||||
* {@code "null"} if {@code array} is {@code null}.
|
||||
* by the characters {@code ", "} (a comma followed by a space).
|
||||
* Returns a {@code "null"} String if {@code array} is {@code null}.
|
||||
* @param array the array to build a String representation for
|
||||
* @return a String representation of {@code array}
|
||||
*/
|
||||
@@ -815,8 +815,8 @@ public abstract class ObjectUtils {
|
||||
* Return a String representation of the contents of the specified array.
|
||||
* <p>The String representation consists of a list of the array's elements,
|
||||
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
|
||||
* by the characters {@code ", "} (a comma followed by a space). Returns
|
||||
* {@code "null"} if {@code array} is {@code null}.
|
||||
* by the characters {@code ", "} (a comma followed by a space).
|
||||
* Returns a {@code "null"} String if {@code array} is {@code null}.
|
||||
* @param array the array to build a String representation for
|
||||
* @return a String representation of {@code array}
|
||||
*/
|
||||
@@ -847,8 +847,8 @@ public abstract class ObjectUtils {
|
||||
* Return a String representation of the contents of the specified array.
|
||||
* <p>The String representation consists of a list of the array's elements,
|
||||
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
|
||||
* by the characters {@code ", "} (a comma followed by a space). Returns
|
||||
* {@code "null"} if {@code array} is {@code null}.
|
||||
* by the characters {@code ", "} (a comma followed by a space).
|
||||
* Returns a {@code "null"} String if {@code array} is {@code null}.
|
||||
* @param array the array to build a String representation for
|
||||
* @return a String representation of {@code array}
|
||||
*/
|
||||
@@ -879,8 +879,8 @@ public abstract class ObjectUtils {
|
||||
* Return a String representation of the contents of the specified array.
|
||||
* <p>The String representation consists of a list of the array's elements,
|
||||
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
|
||||
* by the characters {@code ", "} (a comma followed by a space). Returns
|
||||
* {@code "null"} if {@code array} is {@code null}.
|
||||
* by the characters {@code ", "} (a comma followed by a space).
|
||||
* Returns a {@code "null"} String if {@code array} is {@code null}.
|
||||
* @param array the array to build a String representation for
|
||||
* @return a String representation of {@code array}
|
||||
*/
|
||||
@@ -910,8 +910,8 @@ public abstract class ObjectUtils {
|
||||
* Return a String representation of the contents of the specified array.
|
||||
* <p>The String representation consists of a list of the array's elements,
|
||||
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
|
||||
* by the characters {@code ", "} (a comma followed by a space). Returns
|
||||
* {@code "null"} if {@code array} is {@code null}.
|
||||
* by the characters {@code ", "} (a comma followed by a space).
|
||||
* Returns a {@code "null"} String if {@code array} is {@code null}.
|
||||
* @param array the array to build a String representation for
|
||||
* @return a String representation of {@code array}
|
||||
*/
|
||||
@@ -941,8 +941,8 @@ public abstract class ObjectUtils {
|
||||
* Return a String representation of the contents of the specified array.
|
||||
* <p>The String representation consists of a list of the array's elements,
|
||||
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
|
||||
* by the characters {@code ", "} (a comma followed by a space). Returns
|
||||
* {@code "null"} if {@code array} is {@code null}.
|
||||
* by the characters {@code ", "} (a comma followed by a space).
|
||||
* Returns a {@code "null"} String if {@code array} is {@code null}.
|
||||
* @param array the array to build a String representation for
|
||||
* @return a String representation of {@code array}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -147,8 +147,11 @@ public class MethodJmsListenerEndpoint extends AbstractJmsListenerEndpoint imple
|
||||
Assert.state(this.messageHandlerMethodFactory != null,
|
||||
"Could not create message listener - MessageHandlerMethodFactory not set");
|
||||
MessagingMessageListenerAdapter messageListener = createMessageListenerInstance();
|
||||
Object bean = getBean();
|
||||
Method method = getMethod();
|
||||
Assert.state(bean != null && method != null, "No bean+method set on endpoint");
|
||||
InvocableHandlerMethod invocableHandlerMethod =
|
||||
this.messageHandlerMethodFactory.createInvocableHandlerMethod(getBean(), getMethod());
|
||||
this.messageHandlerMethodFactory.createInvocableHandlerMethod(bean, method);
|
||||
messageListener.setHandlerMethod(invocableHandlerMethod);
|
||||
String responseDestination = getDefaultResponseDestination();
|
||||
if (StringUtils.hasText(responseDestination)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -34,6 +34,7 @@ import org.springframework.validation.ObjectError;
|
||||
@SuppressWarnings("serial")
|
||||
public class MethodArgumentNotValidException extends MethodArgumentResolutionException {
|
||||
|
||||
@Nullable
|
||||
private final BindingResult bindingResult;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -64,7 +64,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
|
||||
* Create an instance wrapping the local user registry.
|
||||
*/
|
||||
public MultiServerUserRegistry(SimpUserRegistry localRegistry) {
|
||||
Assert.notNull(localRegistry, "'localRegistry' is required.");
|
||||
Assert.notNull(localRegistry, "'localRegistry' is required");
|
||||
this.id = generateId();
|
||||
this.localRegistry = localRegistry;
|
||||
this.delegateApplicationEvents = this.localRegistry instanceof SmartApplicationListener;
|
||||
|
||||
@@ -64,19 +64,17 @@ public interface TestContext extends AttributeAccessor, Serializable {
|
||||
/**
|
||||
* Get the current {@linkplain Object test instance} for this test context.
|
||||
* <p>Note: this is a mutable property.
|
||||
* @return the current test instance (may be {@code null})
|
||||
* @return the current test instance (never {@code null})
|
||||
* @see #updateState(Object, Method, Throwable)
|
||||
*/
|
||||
@Nullable
|
||||
Object getTestInstance();
|
||||
|
||||
/**
|
||||
* Get the current {@linkplain Method test method} for this test context.
|
||||
* <p>Note: this is a mutable property.
|
||||
* @return the current test method (may be {@code null})
|
||||
* @return the current test method (never {@code null})
|
||||
* @see #updateState(Object, Method, Throwable)
|
||||
*/
|
||||
@Nullable
|
||||
Method getTestMethod();
|
||||
|
||||
/**
|
||||
@@ -103,7 +101,7 @@ public interface TestContext extends AttributeAccessor, Serializable {
|
||||
|
||||
/**
|
||||
* Update this test context to reflect the state of the currently executing test.
|
||||
* <p><strong>WARNING</strong>: this method should only be invoked by the
|
||||
* <p><strong>WARNING</strong>: This method should only be invoked by the
|
||||
* {@link TestContextManager}.
|
||||
* <p>Caution: concurrent invocations of this method might not be thread-safe,
|
||||
* depending on the underlying implementation.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.web.reactive.server;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
@@ -32,7 +33,7 @@ class DefaultMockServerSpec extends AbstractMockServerSpec<DefaultMockServerSpec
|
||||
|
||||
|
||||
DefaultMockServerSpec(WebHandler webHandler) {
|
||||
Assert.notNull(webHandler, "'WebHandler' is required");
|
||||
Assert.notNull(webHandler, "WebHandler is required");
|
||||
this.webHandler = webHandler;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.web.reactive.server;
|
||||
|
||||
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.web.reactive.server;
|
||||
|
||||
import org.springframework.http.client.reactive.ClientHttpConnector;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -30,7 +30,6 @@ import org.springframework.test.util.XpathExpectationsHelper;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.MimeType;
|
||||
|
||||
|
||||
/**
|
||||
* XPath assertions for the {@link WebTestClient}.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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,30 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
public abstract class AbstractRequestCondition<T extends AbstractRequestCondition<T>> implements RequestCondition<T> {
|
||||
|
||||
/**
|
||||
* Indicates whether this condition is empty, i.e. whether or not it
|
||||
* contains any discrete items.
|
||||
* @return {@code true} if empty; {@code false} otherwise
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return getContent().isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the discrete items a request condition is composed of.
|
||||
* <p>For example URL patterns, HTTP request methods, param expressions, etc.
|
||||
* @return a collection of objects (never {@code null})
|
||||
*/
|
||||
protected abstract Collection<?> getContent();
|
||||
|
||||
/**
|
||||
* The notation to use when printing discrete items of content.
|
||||
* <p>For example {@code " || "} for URL patterns or {@code " && "}
|
||||
* for param expressions.
|
||||
*/
|
||||
protected abstract String getToStringInfix();
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
@@ -58,28 +82,4 @@ public abstract class AbstractRequestCondition<T extends AbstractRequestConditio
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this condition is empty, i.e. whether or not it
|
||||
* contains any discrete items.
|
||||
* @return {@code true} if empty; {@code false} otherwise
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return getContent().isEmpty();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the discrete items a request condition is composed of.
|
||||
* <p>For example URL patterns, HTTP request methods, param expressions, etc.
|
||||
* @return a collection of objects, never {@code null}
|
||||
*/
|
||||
protected abstract Collection<?> getContent();
|
||||
|
||||
/**
|
||||
* The notation to use when printing discrete items of content.
|
||||
* <p>For example {@code " || "} for URL patterns or {@code " && "}
|
||||
* for param expressions.
|
||||
*/
|
||||
protected abstract String getToStringInfix();
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -44,7 +44,7 @@ public abstract class AbstractRequestCondition<T extends AbstractRequestConditio
|
||||
/**
|
||||
* Return the discrete items a request condition is composed of.
|
||||
* <p>For example URL patterns, HTTP request methods, param expressions, etc.
|
||||
* @return a collection of objects, never {@code null}
|
||||
* @return a collection of objects (never {@code null})
|
||||
*/
|
||||
protected abstract Collection<?> getContent();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user