Polish Javadoc for MockFilterChain

This commit is contained in:
Sam Brannen 2022-05-30 18:26:46 +02:00
parent 6f71328ba6
commit b629487b44
2 changed files with 20 additions and 22 deletions

View File

@ -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.
*
* <p>A {@link MockFilterChain} can be configured with one or more filters and a
* <p>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;

View File

@ -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.
*
* <p>A {@link MockFilterChain} can be configured with one or more filters and a
* <p>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;