Polish
Closes gh-33566
This commit is contained in:
@@ -51,7 +51,7 @@ public class JdkClientHttpConnector implements ClientHttpConnector {
|
||||
private DataBufferFactory bufferFactory = DefaultDataBufferFactory.sharedInstance;
|
||||
|
||||
@Nullable
|
||||
private Duration readTimeout = null;
|
||||
private Duration readTimeout;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ChannelSendOperator<T> extends Mono<Void> implements Scannable {
|
||||
* The write subscriber has subscribed, and cached signals have been
|
||||
* emitted to it; we're ready to switch to a simple pass-through mode
|
||||
* for all remaining signals.
|
||||
**/
|
||||
*/
|
||||
READY_TO_WRITE
|
||||
|
||||
}
|
||||
|
||||
@@ -70,10 +70,10 @@ public class RequestAttributesThreadLocalAccessor implements ThreadLocalAccessor
|
||||
|
||||
/**
|
||||
* ServletRequestAttributes that takes another instance, and makes a copy of the
|
||||
* request attributes at present to provides extended read access during async
|
||||
* request attributes at present to provide extended read access during async
|
||||
* handling when the DispatcherServlet has exited from the initial REQUEST dispatch
|
||||
* and marked the request {@link ServletRequestAttributes#requestCompleted()}.
|
||||
* <p>Note that beyond access to request attributes, here is no attempt to support
|
||||
* <p>Note that beyond access to request attributes, there is no attempt to support
|
||||
* setting or removing request attributes, nor to access session attributes after
|
||||
* the initial REQUEST dispatch has exited.
|
||||
*/
|
||||
|
||||
@@ -174,7 +174,7 @@ class Jackson2JsonDecoderTests extends AbstractDecoderTests<Jackson2JsonDecoder>
|
||||
}
|
||||
|
||||
@Test
|
||||
protected void decodeToFluxWithListElements() {
|
||||
void decodeToFluxWithListElements() {
|
||||
Flux<DataBuffer> input = Flux.concat(
|
||||
stringBuffer("[{\"bar\":\"b1\",\"foo\":\"f1\"},{\"bar\":\"b2\",\"foo\":\"f2\"}]"),
|
||||
stringBuffer("[{\"bar\":\"b3\",\"foo\":\"f3\"},{\"bar\":\"b4\",\"foo\":\"f4\"}]"));
|
||||
|
||||
@@ -17,15 +17,12 @@
|
||||
package org.springframework.web.util;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -95,13 +92,7 @@ class ContentCachingRequestWrapperTests {
|
||||
@Test
|
||||
void shouldNotAllocateMoreThanCacheLimit() throws Exception {
|
||||
ContentCachingRequestWrapper wrapper = new ContentCachingRequestWrapper(createGetRequest("Hello World"), CONTENT_CACHE_LIMIT);
|
||||
Field field = ReflectionUtils.findField(ContentCachingRequestWrapper.class, "cachedContent");
|
||||
ReflectionUtils.makeAccessible(field);
|
||||
FastByteArrayOutputStream cachedContent = (FastByteArrayOutputStream) ReflectionUtils.getField(field, wrapper);
|
||||
field = ReflectionUtils.findField(FastByteArrayOutputStream.class, "initialBlockSize");
|
||||
ReflectionUtils.makeAccessible(field);
|
||||
int blockSize = (int) ReflectionUtils.getField(field, cachedContent);
|
||||
assertThat(blockSize).isEqualTo(CONTENT_CACHE_LIMIT);
|
||||
assertThat(wrapper).extracting("cachedContent.initialBlockSize").isEqualTo(CONTENT_CACHE_LIMIT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ public class MockCookie extends Cookie {
|
||||
|
||||
private static final String SAME_SITE = "SameSite";
|
||||
private static final String EXPIRES = "Expires";
|
||||
private static final String PARTITIONED = "Partitioned";
|
||||
|
||||
@Nullable
|
||||
private ZonedDateTime expires;
|
||||
@@ -105,10 +106,10 @@ public class MockCookie extends Cookie {
|
||||
*/
|
||||
public void setPartitioned(boolean partitioned) {
|
||||
if (partitioned) {
|
||||
setAttribute("Partitioned", "");
|
||||
setAttribute(PARTITIONED, "");
|
||||
}
|
||||
else {
|
||||
setAttribute("Partitioned", null);
|
||||
setAttribute(PARTITIONED, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +119,7 @@ public class MockCookie extends Cookie {
|
||||
* @see <a href="https://datatracker.ietf.org/doc/html/draft-cutler-httpbis-partitioned-cookies#section-2.1">The Partitioned attribute spec</a>
|
||||
*/
|
||||
public boolean isPartitioned() {
|
||||
return getAttribute("Partitioned") != null;
|
||||
return getAttribute(PARTITIONED) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -202,7 +203,7 @@ public class MockCookie extends Cookie {
|
||||
.append("Comment", getComment())
|
||||
.append("Secure", getSecure())
|
||||
.append("HttpOnly", isHttpOnly())
|
||||
.append("Partitioned", isPartitioned())
|
||||
.append(PARTITIONED, isPartitioned())
|
||||
.append(SAME_SITE, getSameSite())
|
||||
.append("Max-Age", getMaxAge())
|
||||
.append(EXPIRES, getAttribute(EXPIRES))
|
||||
|
||||
Reference in New Issue
Block a user