diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockFilterChain.java b/spring-test/src/main/java/org/springframework/mock/web/MockFilterChain.java index 39b874b166..f475838d6a 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/MockFilterChain.java +++ b/spring-test/src/main/java/org/springframework/mock/web/MockFilterChain.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 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. @@ -37,7 +37,7 @@ import org.springframework.util.ObjectUtils; /** * Mock implementation of the {@link jakarta.servlet.FilterChain} interface. * - *

A {@link MockFilterChain} can be configured with one or more filters and a + *

A {@code MockFilterChain} can be configured with one or more filters and a * Servlet to invoke. The first time the chain is called, it invokes all filters * and the Servlet, and saves the request and response. Subsequent invocations * raise an {@link IllegalStateException} unless {@link #reset()} is called. @@ -64,17 +64,15 @@ public class MockFilterChain implements FilterChain { /** - * Register a single do-nothing {@link Filter} implementation. The first - * invocation saves the request and response. Subsequent invocations raise - * an {@link IllegalStateException} unless {@link #reset()} is called. + * Create an empty {@code MockFilterChain} without any {@linkplain Filter filters}. */ public MockFilterChain() { this.filters = Collections.emptyList(); } /** - * Create a FilterChain with a Servlet. - * @param servlet the Servlet to invoke + * Create a {@code MockFilterChain} with a {@link Servlet}. + * @param servlet the {@code Servlet} to invoke * @since 3.2 */ public MockFilterChain(Servlet servlet) { @@ -82,9 +80,10 @@ public class MockFilterChain implements FilterChain { } /** - * Create a {@code FilterChain} with Filter's and a Servlet. - * @param servlet the {@link Servlet} to invoke in this {@link FilterChain} - * @param filters the {@link Filter}'s to invoke in this {@link FilterChain} + * Create a {@code MockFilterChain} with a {@link Servlet} and {@linkplain Filter + * filters}. + * @param servlet the {@code Servlet} to invoke in this {@code MockFilterChain} + * @param filters the filters to invoke in this {@code MockFilterChain} * @since 3.2 */ public MockFilterChain(Servlet servlet, Filter... filters) { @@ -139,7 +138,7 @@ public class MockFilterChain implements FilterChain { } /** - * Reset the {@link MockFilterChain} allowing it to be invoked again. + * Reset this {@code MockFilterChain} allowing it to be invoked again. */ public void reset() { this.request = null; diff --git a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockFilterChain.java b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockFilterChain.java index ed7b3d93dd..635471aa5f 100644 --- a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockFilterChain.java +++ b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockFilterChain.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 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. @@ -37,7 +37,7 @@ import org.springframework.util.ObjectUtils; /** * Mock implementation of the {@link jakarta.servlet.FilterChain} interface. * - *

A {@link MockFilterChain} can be configured with one or more filters and a + *

A {@code MockFilterChain} can be configured with one or more filters and a * Servlet to invoke. The first time the chain is called, it invokes all filters * and the Servlet, and saves the request and response. Subsequent invocations * raise an {@link IllegalStateException} unless {@link #reset()} is called. @@ -64,17 +64,15 @@ public class MockFilterChain implements FilterChain { /** - * Register a single do-nothing {@link Filter} implementation. The first - * invocation saves the request and response. Subsequent invocations raise - * an {@link IllegalStateException} unless {@link #reset()} is called. + * Create an empty {@code MockFilterChain} without any {@linkplain Filter filters}. */ public MockFilterChain() { this.filters = Collections.emptyList(); } /** - * Create a FilterChain with a Servlet. - * @param servlet the Servlet to invoke + * Create a {@code MockFilterChain} with a {@link Servlet}. + * @param servlet the {@code Servlet} to invoke * @since 3.2 */ public MockFilterChain(Servlet servlet) { @@ -82,9 +80,10 @@ public class MockFilterChain implements FilterChain { } /** - * Create a {@code FilterChain} with Filter's and a Servlet. - * @param servlet the {@link Servlet} to invoke in this {@link FilterChain} - * @param filters the {@link Filter}'s to invoke in this {@link FilterChain} + * Create a {@code MockFilterChain} with a {@link Servlet} and {@linkplain Filter + * filters}. + * @param servlet the {@code Servlet} to invoke in this {@code MockFilterChain} + * @param filters the filters to invoke in this {@code MockFilterChain} * @since 3.2 */ public MockFilterChain(Servlet servlet, Filter... filters) { @@ -139,7 +138,7 @@ public class MockFilterChain implements FilterChain { } /** - * Reset the {@link MockFilterChain} allowing it to be invoked again. + * Reset this {@code MockFilterChain} allowing it to be invoked again. */ public void reset() { this.request = null;