Fix javadoc checkstyle issues

Fix checkstyle violations for javadoc.

Issue: SPR-16968
This commit is contained in:
Phillip Webb
2018-06-20 18:45:54 -07:00
committed by Juergen Hoeller
parent 032096d699
commit e0480f75ac
928 changed files with 3729 additions and 2686 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -83,7 +83,7 @@ import org.springframework.util.ReflectionUtils;
*/
public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder {
/** An instance of this class bound to JNDI */
/** An instance of this class bound to JNDI. */
@Nullable
private static volatile SimpleNamingContextBuilder activated;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -115,7 +115,7 @@ public class MockFilterChain implements FilterChain {
}
/**
* Invoke registered {@link Filter}s and/or {@link Servlet} also saving the
* Invoke registered {@link Filter Filters} and/or {@link Servlet} also saving the
* request and response.
*/
@Override

View File

@@ -102,7 +102,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
new BufferedReader(new StringReader(""));
/**
* Date formats as specified in the HTTP RFC
* Date formats as specified in the HTTP RFC.
* @see <a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.1">Section 7.1.1.1 of RFC 7231</a>
*/
private static final String[] DATE_FORMATS = new String[] {
@@ -198,7 +198,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
private String remoteHost = DEFAULT_REMOTE_HOST;
/** List of locales in descending order */
/** List of locales in descending order. */
private final List<Locale> locales = new LinkedList<>();
private boolean secure = false;
@@ -785,8 +785,8 @@ public class MockHttpServletRequest implements HttpServletRequest {
/**
* Set the list of preferred locales, in descending order, effectively replacing
* any existing locales.
* @see #addPreferredLocale
* @since 3.2
* @see #addPreferredLocale
*/
public void setPreferredLocales(List<Locale> locales) {
Assert.notEmpty(locales, "Locale list must not be empty");

View File

@@ -47,6 +47,9 @@ import org.springframework.util.StringUtils;
@SuppressWarnings("deprecation")
public class MockHttpSession implements HttpSession {
/**
* The session cookie name.
*/
public static final String SESSION_COOKIE_NAME = "JSESSION";

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -86,7 +86,7 @@ import org.springframework.web.util.WebUtils;
*/
public class MockServletContext implements ServletContext {
/** Default Servlet name used by Tomcat, Jetty, JBoss, and GlassFish: {@value} */
/** Default Servlet name used by Tomcat, Jetty, JBoss, and GlassFish: {@value}. */
private static final String COMMON_DEFAULT_SERVLET_NAME = "default";
private static final String TEMP_DIR_SYSTEM_PROPERTY = "java.io.tmpdir";

View File

@@ -293,6 +293,7 @@ public class MockServerRequest implements ServerRequest {
Builder session(WebSession session);
/**
* Sets the request {@link Principal}.
* @deprecated in favor of {@link #principal(Principal)}
*/
@Deprecated

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -54,7 +54,7 @@ public abstract class ProfileValueUtils {
* &#064;ProfileValueSourceConfiguration} is not present on the specified
* class or if a custom {@link ProfileValueSource} is not declared, the
* default {@link SystemProfileValueSource} will be returned instead.
* @param testClass The test class for which the ProfileValueSource should
* @param testClass the test class for which the ProfileValueSource should
* be retrieved
* @return the configured (or default) ProfileValueSource for the specified
* class

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 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.
@@ -203,13 +203,13 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
* customize {@code GenericApplicationContext}'s standard settings.
*
* @param context the context that should be prepared
* @since 2.5
* @see #loadContext(MergedContextConfiguration)
* @see #loadContext(String...)
* @see GenericApplicationContext#setAllowBeanDefinitionOverriding
* @see GenericApplicationContext#setResourceLoader
* @see GenericApplicationContext#setId
* @see #prepareContext(ConfigurableApplicationContext, MergedContextConfiguration)
* @since 2.5
*/
protected void prepareContext(GenericApplicationContext context) {
}
@@ -222,13 +222,13 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
* to customize {@code DefaultListableBeanFactory}'s standard settings.
*
* @param beanFactory the bean factory created by this {@code ContextLoader}
* @since 2.5
* @see #loadContext(MergedContextConfiguration)
* @see #loadContext(String...)
* @see DefaultListableBeanFactory#setAllowBeanDefinitionOverriding
* @see DefaultListableBeanFactory#setAllowEagerClassLoading
* @see DefaultListableBeanFactory#setAllowCircularReferences
* @see DefaultListableBeanFactory#setAllowRawInjectionDespiteWrapping
* @since 2.5
*/
protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory) {
}
@@ -250,8 +250,8 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
*
* @param context the context into which the bean definitions should be loaded
* @param mergedConfig the merged context configuration
* @see #loadContext(MergedContextConfiguration)
* @since 3.1
* @see #loadContext(MergedContextConfiguration)
*/
protected void loadBeanDefinitions(GenericApplicationContext context, MergedContextConfiguration mergedConfig) {
createBeanDefinitionReader(context).loadBeanDefinitions(mergedConfig.getLocations());
@@ -264,10 +264,10 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
* @param context the context for which the {@code BeanDefinitionReader}
* should be created
* @return a {@code BeanDefinitionReader} for the supplied context
* @since 2.5
* @see #loadContext(String...)
* @see #loadBeanDefinitions
* @see BeanDefinitionReader
* @since 2.5
*/
protected abstract BeanDefinitionReader createBeanDefinitionReader(GenericApplicationContext context);
@@ -280,10 +280,10 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
* to customize the application context.
*
* @param context the newly created application context
* @since 2.5
* @see #loadContext(MergedContextConfiguration)
* @see #loadContext(String...)
* @see #customizeContext(ConfigurableApplicationContext, MergedContextConfiguration)
* @since 2.5
*/
protected void customizeContext(GenericApplicationContext context) {
}

View File

@@ -100,9 +100,9 @@ public class DefaultTestContext implements TestContext {
* test context.
* <p>The default implementation delegates to the {@link CacheAwareContextLoaderDelegate}
* that was supplied when this {@code TestContext} was constructed.
* @see CacheAwareContextLoaderDelegate#loadContext
* @throws IllegalStateException if the context returned by the context
* loader delegate is not <em>active</em> (i.e., has been closed).
* @see CacheAwareContextLoaderDelegate#loadContext
*/
public ApplicationContext getApplicationContext() {
ApplicationContext context = this.cacheAwareContextLoaderDelegate.loadContext(this.mergedContextConfiguration);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -151,11 +151,11 @@ public abstract class TestPropertySourceUtils {
* never {@code null}
* @param locations the resource locations of {@code Properties} files to add
* to the environment; potentially empty but never {@code null}
* @throws IllegalStateException if an error occurs while processing a properties file
* @since 4.1.5
* @see ResourcePropertySource
* @see TestPropertySource#locations
* @see #addPropertiesFilesToEnvironment(ConfigurableEnvironment, ResourceLoader, String...)
* @throws IllegalStateException if an error occurs while processing a properties file
*/
public static void addPropertiesFilesToEnvironment(ConfigurableApplicationContext context, String... locations) {
Assert.notNull(context, "'context' must not be null");
@@ -177,11 +177,11 @@ public abstract class TestPropertySourceUtils {
* never {@code null}
* @param locations the resource locations of {@code Properties} files to add
* to the environment; potentially empty but never {@code null}
* @throws IllegalStateException if an error occurs while processing a properties file
* @since 4.3
* @see ResourcePropertySource
* @see TestPropertySource#locations
* @see #addPropertiesFilesToEnvironment(ConfigurableApplicationContext, String...)
* @throws IllegalStateException if an error occurs while processing a properties file
*/
public static void addPropertiesFilesToEnvironment(ConfigurableEnvironment environment,
ResourceLoader resourceLoader, String... locations) {
@@ -266,9 +266,9 @@ public abstract class TestPropertySourceUtils {
* @param inlinedProperties the inlined properties to convert; potentially empty
* but never {@code null}
* @return a new, ordered map containing the converted properties
* @since 4.1.5
* @throws IllegalStateException if a given key-value pair cannot be parsed, or if
* a given inlined property contains multiple key-value pairs
* @since 4.1.5
* @see #addInlinedPropertiesToEnvironment(ConfigurableEnvironment, String[])
*/
public static Map<String, Object> convertInlinedPropertiesToMap(String... inlinedProperties) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -88,7 +88,7 @@ import org.springframework.test.context.web.ServletTestExecutionListener;
DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class })
public abstract class AbstractTestNGSpringContextTests implements IHookable, ApplicationContextAware {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass());
/**

View File

@@ -77,6 +77,7 @@ public abstract class TestContextTransactionUtils {
* <li>Attempt to look up the <em>primary</em> {@code DataSource} by type.
* <li>Attempt to look up the {@code DataSource} by type and the
* {@linkplain #DEFAULT_DATA_SOURCE_NAME default data source name}.
* </ol>
* @param testContext the test context for which the {@code DataSource}
* should be retrieved; never {@code null}
* @param name the name of the {@code DataSource} to retrieve
@@ -148,6 +149,7 @@ public abstract class TestContextTransactionUtils {
* <li>Attempt to look up the transaction manager by type and the
* {@linkplain #DEFAULT_TRANSACTION_MANAGER_NAME default transaction manager
* name}.
* </ol>
* @param testContext the test context for which the transaction manager
* should be retrieved; never {@code null}
* @param name the name of the transaction manager to retrieve

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -61,6 +61,7 @@ public abstract class TestContextResourceUtils {
* {@link ResourceUtils#CLASSPATH_URL_PREFIX classpath:},
* {@link ResourceUtils#FILE_URL_PREFIX file:}, {@code http:}, etc.) will be
* {@link StringUtils#cleanPath cleaned} but otherwise unmodified.
* </ul>
* @param clazz the class with which the paths are associated
* @param paths the paths to be converted
* @return a new array of converted resource paths

View File

@@ -170,6 +170,7 @@ public abstract class AbstractGenericWebContextLoader extends AbstractContextLoa
* {@link WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} key.</li>
* <li>Finally, the {@code MockServletContext} is set in the
* {@code WebApplicationContext}.</li>
* </ul>
* @param context the web application context for which to configure the web resources
* @param webMergedConfig the merged context configuration to use to load the web application context
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -22,7 +22,7 @@ import org.skyscreamer.jsonassert.JSONAssert;
* A helper class for assertions on JSON content.
*
* <p>Use of this class requires the <a
* href="http://jsonassert.skyscreamer.org/">JSONassert<a/> library.
* href="http://jsonassert.skyscreamer.org/">JSONassert</a> library.
*
* @author Sebastien Deleuze
* @since 4.1

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -280,6 +280,8 @@ public abstract class MetaAnnotationUtils {
* &#064;RepositoryTests
* public class UserRepositoryTests { }
* </pre>
*
* @param <T> the annotation type
*/
public static class AnnotationDescriptor<T extends Annotation> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -72,7 +72,7 @@ public class XmlExpectationsHelper {
* two are "similar" -- i.e. they contain the same elements and attributes
* regardless of order.
* <p>Use of this method assumes the
* <a href="https://github.com/xmlunit/xmlunit">XMLUnit<a/> library is available.
* <a href="https://github.com/xmlunit/xmlunit">XMLUnit</a> library is available.
* @param expected the expected XML content
* @param actual the actual XML content
* @see org.springframework.test.web.servlet.result.MockMvcResultMatchers#xpath(String, Object...)

View File

@@ -60,7 +60,7 @@ public class XpathExpectationsHelper {
/**
* XpathExpectationsHelper constructor.
* @param expression the XPath expression
* @param namespaces XML namespaces referenced in the XPath expression, or {@code null}
* @param namespaces the XML namespaces referenced in the XPath expression, or {@code null}
* @param args arguments to parameterize the XPath expression with using the
* formatting specifiers defined in {@link String#format(String, Object...)}
* @throws XPathExpressionException if expression compilation failed

View File

@@ -33,7 +33,7 @@ import static org.springframework.test.util.AssertionErrors.*;
* ModelAndView} objects.
*
* <p>Intended for use with JUnit 4 and TestNG. All {@code assert*()} methods
* throw {@link AssertionError}s.
* throw {@link AssertionError AssertionErrors}.
*
* @author Sam Brannen
* @author Alef Arendsen
@@ -47,7 +47,7 @@ public abstract class ModelAndViewAssert {
* Checks whether the model value under the given {@code modelName}
* exists and checks it type, based on the {@code expectedType}. If the
* model entry exists and the type matches, the model value is returned.
* @param mav ModelAndView to test against (never {@code null})
* @param mav the ModelAndView to test against (never {@code null})
* @param modelName name of the object to add to the model (never {@code null})
* @param expectedType expected type of the model value
* @return the model value
@@ -66,7 +66,7 @@ public abstract class ModelAndViewAssert {
/**
* Compare each individual entry in a list, without first sorting the lists.
* @param mav ModelAndView to test against (never {@code null})
* @param mav the ModelAndView to test against (never {@code null})
* @param modelName name of the object to add to the model (never {@code null})
* @param expectedList the expected list
*/
@@ -81,7 +81,7 @@ public abstract class ModelAndViewAssert {
/**
* Assert whether or not a model attribute is available.
* @param mav ModelAndView to test against (never {@code null})
* @param mav the ModelAndView to test against (never {@code null})
* @param modelName name of the object to add to the model (never {@code null})
*/
public static void assertModelAttributeAvailable(ModelAndView mav, String modelName) {
@@ -92,7 +92,7 @@ public abstract class ModelAndViewAssert {
/**
* Compare a given {@code expectedValue} to the value from the model
* bound under the given {@code modelName}.
* @param mav ModelAndView to test against (never {@code null})
* @param mav the ModelAndView to test against (never {@code null})
* @param modelName name of the object to add to the model (never {@code null})
* @param expectedValue the model value
*/
@@ -105,7 +105,7 @@ public abstract class ModelAndViewAssert {
/**
* Inspect the {@code expectedModel} to see if all elements in the
* model appear and are equal.
* @param mav ModelAndView to test against (never {@code null})
* @param mav the ModelAndView to test against (never {@code null})
* @param expectedModel the expected model
*/
public static void assertModelAttributeValues(ModelAndView mav, Map<String, Object> expectedModel) {
@@ -135,7 +135,7 @@ public abstract class ModelAndViewAssert {
/**
* Compare each individual entry in a list after having sorted both lists
* (optionally using a comparator).
* @param mav ModelAndView to test against (never {@code null})
* @param mav the ModelAndView to test against (never {@code null})
* @param modelName name of the object to add to the model (never {@code null})
* @param expectedList the expected list
* @param comparator the comparator to use (may be {@code null}). If not
@@ -159,7 +159,7 @@ public abstract class ModelAndViewAssert {
/**
* Check to see if the view name in the ModelAndView matches the given
* {@code expectedName}.
* @param mav ModelAndView to test against (never {@code null})
* @param mav the ModelAndView to test against (never {@code null})
* @param expectedName the name of the model value
*/
public static void assertViewName(ModelAndView mav, String expectedName) {

View File

@@ -37,11 +37,11 @@ import org.springframework.util.Assert;
*/
public class SimpleRequestExpectationManager extends AbstractRequestExpectationManager {
/** Expectations in the order of declaration (count may be > 1) */
/** Expectations in the order of declaration (count may be > 1). */
@Nullable
private Iterator<RequestExpectation> expectationIterator;
/** Track expectations that have a remaining count */
/** Track expectations that have a remaining count. */
private final RequestExpectationGroup repeatExpectations = new RequestExpectationGroup();

View File

@@ -161,7 +161,7 @@ public class ContentRequestMatchers {
* two are "similar" - i.e. they contain the same elements and attributes
* regardless of order.
* <p>Use of this matcher assumes the
* <a href="http://xmlunit.sourceforge.net/">XMLUnit<a/> library is available.
* <a href="http://xmlunit.sourceforge.net/">XMLUnit</a> library is available.
* @param expectedXmlContent the expected XML content
*/
public RequestMatcher xml(final String expectedXmlContent) {
@@ -204,7 +204,7 @@ public class ContentRequestMatchers {
* regardless of formatting with a lenient checking (extensible, and non-strict array
* ordering).
* <p>Use of this matcher requires the <a
* href="http://jsonassert.skyscreamer.org/">JSONassert<a/> library.
* href="http://jsonassert.skyscreamer.org/">JSONassert</a> library.
* @param expectedJsonContent the expected JSON content
* @since 5.0.5
*/
@@ -222,7 +222,7 @@ public class ContentRequestMatchers {
* <li>{@code false}: lenient checking. Extensible, and non-strict array ordering.</li>
* </ul>
* <p>Use of this matcher requires the <a
* href="http://jsonassert.skyscreamer.org/">JSONassert<a/> library.
* href="http://jsonassert.skyscreamer.org/">JSONassert</a> library.
* @param expectedJsonContent the expected JSON content
* @param strict enables strict checking
* @since 5.0.5

View File

@@ -281,7 +281,7 @@ public class JsonPathRequestMatchers {
/**
* Abstract base class for {@code JsonPath}-based {@link RequestMatcher}s.
* Abstract base class for {@code JsonPath}-based {@link RequestMatcher RequestMatchers}.
* @see #matchInternal
*/
private abstract static class AbstractJsonPathRequestMatcher implements RequestMatcher {

View File

@@ -68,7 +68,7 @@ public abstract class MockRestRequestMatchers {
/**
* Assert the request URI string with the given Hamcrest matcher.
* @param matcher String matcher for the expected URI
* @param matcher the String matcher for the expected URI
* @return the request matcher
*/
public static RequestMatcher requestTo(final Matcher<String> matcher) {

View File

@@ -49,7 +49,7 @@ public class XpathRequestMatchers {
* {@link MockRestRequestMatchers#xpath(String, Object...)} or
* {@link MockRestRequestMatchers#xpath(String, Map, Object...)}.
* @param expression the XPath expression
* @param namespaces XML namespaces referenced in the XPath expression, or {@code null}
* @param namespaces the XML namespaces referenced in the XPath expression, or {@code null}
* @param args arguments to parameterize the XPath expression with using the
* formatting specifiers defined in {@link String#format(String, Object...)}
* @throws XPathExpressionException if expression compilation failed

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -31,6 +31,7 @@ import org.springframework.web.server.session.WebSessionManager;
*
* @author Rossen Stoyanchev
* @since 5.0
* @param <B> a self reference to the builder type
*/
abstract class AbstractMockServerSpec<B extends WebTestClient.MockServerSpec<B>>
implements WebTestClient.MockServerSpec<B> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -52,22 +52,22 @@ class DefaultWebTestClientBuilder implements WebTestClient.Builder {
private Duration responseTimeout;
/** Connect to server via Reactor Netty */
/** Connect to server via Reactor Netty. */
DefaultWebTestClientBuilder() {
this(new ReactorClientHttpConnector());
}
/** Connect to server through the given connector */
/** Connect to server through the given connector. */
DefaultWebTestClientBuilder(ClientHttpConnector connector) {
this(null, null, connector, null);
}
/** Connect to given mock server with mock request and response */
/** Connect to given mock server with mock request and response. */
DefaultWebTestClientBuilder(WebHttpHandlerBuilder httpHandlerBuilder) {
this(null, httpHandlerBuilder, null, null);
}
/** Copy constructor */
/** Copy constructor. */
DefaultWebTestClientBuilder(DefaultWebTestClientBuilder other) {
this(other.webClientBuilder.clone(), other.httpHandlerBuilder, other.connector,
other.responseTimeout);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -28,10 +28,9 @@ import org.springframework.lang.Nullable;
* {@code ExchangeResult} variant with the response body decoded as
* {@code Flux<T>} but not yet consumed.
*
* @param <T> the type of elements in the response body
*
* @author Rossen Stoyanchev
* @since 5.0
* @param <T> the type of elements in the response body
* @see EntityExchangeResult
*/
public class FluxExchangeResult<T> extends ExchangeResult {
@@ -61,7 +60,7 @@ public class FluxExchangeResult<T> extends ExchangeResult {
* consumed from the (possibly infinite) stream:
*
* <pre>
* FluxExchangeResult<Person> result = this.client.get()
* FluxExchangeResult&lt;Person&gt; result = this.client.get()
* .uri("/persons")
* .accept(TEXT_EVENT_STREAM)
* .exchange()

View File

@@ -60,7 +60,7 @@ public class HeaderAssertions {
* Expect a header with the given name whose first value matches the
* provided regex pattern.
* @param name the header name
* @param pattern String pattern to pass to {@link Pattern#compile(String)}
* @param pattern the String pattern to pass to {@link Pattern#compile(String)}
*/
public WebTestClient.ResponseSpec valueMatches(String name, String pattern) {
String value = getHeaders().getFirst(name);

View File

@@ -248,6 +248,8 @@ public interface WebTestClient {
/**
* Base specification for setting up tests without a server.
*
* @param <B> a self reference to the builder type
*/
interface MockServerSpec<B extends MockServerSpec<B>> {
@@ -457,6 +459,8 @@ public interface WebTestClient {
/**
* Specification for providing the URI of a request.
*
* @param <S> a self reference to the spec type
*/
interface UriSpec<S extends RequestHeadersSpec<?>> {
@@ -493,6 +497,8 @@ public interface WebTestClient {
/**
* Specification for adding request headers and performing an exchange.
*
* @param <S> a self reference to the spec type
*/
interface RequestHeadersSpec<S extends RequestHeadersSpec<S>> {
@@ -591,6 +597,9 @@ public interface WebTestClient {
}
/**
* Specification for providing body of a request.
*/
interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> {
/**
* Set the length of the body in bytes, as specified by the
@@ -649,10 +658,17 @@ public interface WebTestClient {
}
/**
* Specification for providing request headers and the URI of a request.
*
* @param <S> a self reference to the spec type
*/
interface RequestHeadersUriSpec<S extends RequestHeadersSpec<S>> extends UriSpec<S>, RequestHeadersSpec<S> {
}
/**
* Specification for providing the body and the URI of a request.
*/
interface RequestBodyUriSpec extends RequestBodySpec, RequestHeadersUriSpec<RequestBodySpec> {
}
@@ -730,6 +746,9 @@ public interface WebTestClient {
/**
* Spec for expectations on the response body decoded to a single Object.
*
* @param <S> a self reference to the spec type
* @param <B> the body type
*/
interface BodySpec<B, S extends BodySpec<B, S>> {
@@ -753,6 +772,8 @@ public interface WebTestClient {
/**
* Spec for expectations on the response body decoded to a List.
*
* @param <E> the body list element type
*/
interface ListBodySpec<E> extends BodySpec<List<E>, ListBodySpec<E>> {
@@ -792,7 +813,7 @@ public interface WebTestClient {
* Parse the expected and actual response content as JSON and perform a
* "lenient" comparison verifying the same attribute-value pairs.
* <p>Use of this option requires the
* <a href="http://jsonassert.skyscreamer.org/">JSONassert<a/> library
* <a href="http://jsonassert.skyscreamer.org/">JSONassert</a> library
* on to be on the classpath.
* @param expectedJson the expected JSON content.
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -99,6 +99,9 @@ class WiretapConnector implements ClientHttpConnector {
}
/**
* Holder for {@link WiretapClientHttpRequest} and {@link WiretapClientHttpResponse}.
*/
class Info {
private final WiretapClientHttpRequest request;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 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.
@@ -20,7 +20,7 @@ import org.springframework.mock.web.MockHttpServletRequest;
/**
* Extended variant of a {@link RequestBuilder} that applies its
* {@link org.springframework.test.web.servlet.request.RequestPostProcessor}s
* {@link org.springframework.test.web.servlet.request.RequestPostProcessor org.springframework.test.web.servlet.request.RequestPostProcessors}
* as a separate step from the {@link #buildRequest} method.
*
* @author Rossen Stoyanchev
@@ -30,7 +30,7 @@ public interface SmartRequestBuilder extends RequestBuilder {
/**
* Apply request post processing. Typically that means invoking one or more
* {@link org.springframework.test.web.servlet.request.RequestPostProcessor}s.
* {@link org.springframework.test.web.servlet.request.RequestPostProcessor org.springframework.test.web.servlet.request.RequestPostProcessors}.
*
* @param request the request to initialize
* @return the request to use, either the one passed in or a wrapped one

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -87,6 +87,9 @@ public final class DelegatingWebConnection implements WebConnection {
}
/**
* The delegate web connection.
*/
public static final class DelegateWebConnection {
private final WebRequestMatcher matcher;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -21,6 +21,8 @@ import org.springframework.test.web.servlet.request.RequestPostProcessor;
import org.springframework.util.Assert;
/**
* {@link RequestPostProcessor} for forward requests.
*
* @author Rob Winch
* @author Sam Brannen
* @since 4.2

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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,6 +40,7 @@ import org.springframework.web.context.WebApplicationContext;
* @author Rob Winch
* @author Sam Brannen
* @since 4.2
* @param <T> a self reference to the builder type
*/
public abstract class MockMvcWebConnectionBuilderSupport<T extends MockMvcWebConnectionBuilderSupport<T>> {
@@ -144,10 +145,10 @@ public abstract class MockMvcWebConnectionBuilderSupport<T extends MockMvcWebCon
* {@code WebRequestMatcher} instances matches (never {@code null})
* @return a new {@code WebConnection} that will use a {@code MockMvc}
* instance if one of the specified {@code WebRequestMatcher} matches
* @since 4.3
* @see #alwaysUseMockMvc()
* @see #useMockMvc(WebRequestMatcher...)
* @see #useMockMvcForHosts(String...)
* @since 4.3
*/
protected final WebConnection createConnection(WebClient webClient) {
Assert.notNull(webClient, "WebClient must not be null");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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,8 @@ import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* Builder used internally to create {@link WebResponse WebResponses}.
*
* @author Rob Winch
* @author Sam Brannen
* @author Rossen Stoyanchev

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 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.
@@ -20,10 +20,11 @@ import org.springframework.test.web.servlet.SmartRequestBuilder;
/**
* An extension of {@link org.springframework.test.web.servlet.SmartRequestBuilder
* SmartRequestBuilder} that can be configured with {@link RequestPostProcessor}s.
* SmartRequestBuilder} that can be configured with {@link RequestPostProcessor RequestPostProcessors}.
*
* @author Rossen Stoyanchev
* @since 4.1
* @param <B> a self reference to the builder type
*/
public interface ConfigurableSmartRequestBuilder<B extends ConfigurableSmartRequestBuilder<B>>
extends SmartRequestBuilder {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -148,7 +148,7 @@ public class ContentResultMatchers {
* are "similar" - i.e. they contain the same elements and attributes
* regardless of order.
* <p>Use of this matcher requires the <a
* href="http://xmlunit.sourceforge.net/">XMLUnit<a/> library.
* href="http://xmlunit.sourceforge.net/">XMLUnit</a> library.
* @param xmlContent the expected XML content
* @see MockMvcResultMatchers#xpath(String, Object...)
* @see MockMvcResultMatchers#xpath(String, Map, Object...)
@@ -204,7 +204,7 @@ public class ContentResultMatchers {
* <li>{@code false}: lenient checking. Extensible, and non-strict array ordering.</li>
* </ul>
* <p>Use of this matcher requires the <a
* href="http://jsonassert.skyscreamer.org/">JSONassert<a/> library.
* href="http://jsonassert.skyscreamer.org/">JSONassert</a> library.
* @param jsonContent the expected JSON content
* @param strict enables strict checking
* @since 4.2

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -164,7 +164,7 @@ public class CookieResultMatchers {
}
/**
* Assert a cookie's version with a Hamcrest {@link Matcher}
* Assert a cookie's version with a Hamcrest {@link Matcher}.
*/
public ResultMatcher version(final String name, final Matcher<? super Integer> matcher) {
return result -> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -84,7 +84,7 @@ public class HandlerResultMatchers {
* public class SimpleController {
*
* &#064;RequestMapping("/")
* public ResponseEntity<Void> handle() {
* public ResponseEntity&lt;Void&gt; handle() {
* return ResponseEntity.ok().build();
* }
* }

View File

@@ -131,8 +131,8 @@ public class HeaderResultMatchers {
* <p>The {@link ResultMatcher} returned by this method throws an
* {@link AssertionError} if the response does not contain the specified
* header, or if the supplied {@code value} does not match the primary value.
* @see <a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.1">Section 7.1.1.1 of RFC 7231</a>
* @since 4.2
* @see <a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.1">Section 7.1.1.1 of RFC 7231</a>
*/
public ResultMatcher dateValue(final String name, final long value) {
return result -> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -82,7 +82,7 @@ public class ModelResultMatchers {
}
/**
* Assert the given model attributes do not exist
* Assert the given model attributes do not exist.
*/
public ResultMatcher attributeDoesNotExist(final String... names) {
return result -> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -71,7 +71,8 @@ public class PrintingResultHandler implements ResultHandler {
}
/**
* @return the result value printer
* Return the result value printer.
* @return the printer
*/
protected ResultValuePrinter getPrinter() {
return this.printer;

View File

@@ -613,7 +613,7 @@ public class StatusResultMatchers {
}
/**
* Match the expected response status to that of the HttpServletResponse
* Match the expected response status to that of the HttpServletResponse.
*/
private ResultMatcher matcher(final HttpStatus status) {
return result -> assertEquals("Status", status.value(), result.getResponse().getStatus());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -46,7 +46,7 @@ public class XpathResultMatchers {
* {@link MockMvcResultMatchers#xpath(String, Object...)} or
* {@link MockMvcResultMatchers#xpath(String, Map, Object...)}.
* @param expression the XPath expression
* @param namespaces XML namespaces referenced in the XPath expression, or {@code null}
* @param namespaces the XML namespaces referenced in the XPath expression, or {@code null}
* @param args arguments to parameterize the XPath expression with using the
* formatting specifiers defined in {@link String#format(String, Object...)}
*/

View File

@@ -48,6 +48,7 @@ import org.springframework.web.context.WebApplicationContext;
* @author Rossen Stoyanchev
* @author Stephane Nicoll
* @since 4.0
* @param <B> a self reference to the builder type
*/
public abstract class AbstractMockMvcBuilder<B extends AbstractMockMvcBuilder<B>>
extends MockMvcBuilderSupport implements ConfigurableMockMvcBuilder<B> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -28,6 +28,7 @@ import org.springframework.test.web.servlet.ResultMatcher;
*
* @author Rossen Stoyanchev
* @since 4.1
* @param <B> a self reference to the builder type
*/
public interface ConfigurableMockMvcBuilder<B extends ConfigurableMockMvcBuilder<B>> extends MockMvcBuilder {
@@ -62,7 +63,7 @@ public interface ConfigurableMockMvcBuilder<B extends ConfigurableMockMvcBuilder
* </pre>
* <p>Filters will be invoked in the order in which they are provided.
* @param filter the filter to add
* @param urlPatterns URL patterns to map to; if empty, "/*" is used by default
* @param urlPatterns the URL patterns to map to; if empty, "/*" is used by default
*/
<T extends B> T addFilter(Filter filter, String... urlPatterns);

View File

@@ -21,7 +21,7 @@ import org.springframework.test.web.servlet.MockMvcBuilder;
import org.springframework.web.context.WebApplicationContext;
/**
* The main class to import in order to access all available {@link MockMvcBuilder}s.
* The main class to import in order to access all available {@link MockMvcBuilder MockMvcBuilders}.
*
* <h3>Eclipse Users</h3>
* <p>Consider adding this class as a Java editor favorite. To navigate to

View File

@@ -268,7 +268,7 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder<StandaloneM
}
/**
* Set up view resolution with the given {@link ViewResolver}s.
* Set up view resolution with the given {@link ViewResolver ViewResolvers}.
* If not set, an {@link InternalResourceViewResolver} is used by default.
*/
public StandaloneMockMvcBuilder setViewResolvers(ViewResolver...resolvers) {
@@ -413,7 +413,7 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder<StandaloneM
}
/** Using the MVC Java configuration as the starting point for the "standalone" setup */
/** Using the MVC Java configuration as the starting point for the "standalone" setup. */
private class StandaloneConfiguration extends WebMvcConfigurationSupport {
public RequestMappingHandlerMapping getHandlerMapping() {